We are facing issue with confd 7.1, performance is slow for loading config data XML with >2.5 MB file. Below is the code snippet for RPC request with edit-config.
String topXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">" + "<edit-config>" + "<target>" + "<running/>"
+ "</target>" +
"<default-operation>"+operationType+"</default-operation>\r\n" +
"<config>";
String endXml = " </config>" + "</edit-config>" + "</rpc>";
String rpc = topXml + snapshot + endXml;
rpc = rpc.replaceAll("\\s*xmlns\\s*=\"\"", "");
device = getDevice();
if (device == null) {
device = getDevice();
closeDevice = true;
}
String reply;
NetconfSession netSession = device.getSession(confdIp + "_" + "RPC_SESSION");
Element rpcData = netSession.rpc(rpc);
reply = rpcData.toXMLString();
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>jnc</artifactId>
<version>1.0</version>
</dependency>
We have enabled trace to the check the request time and resposne time:
<INFO> 23-Aug-2022::06:42:43.019 confd[58381]: netconf id=21 new ssh session for user "admin" from 127.0.0.1
<INFO> 23-Aug-2022::06:42:43.028 confd[58381]: netconf id=22 new ssh session for user "admin" from 127.0.0.1
<INFO> 23-Aug-2022::06:42:43.042 confd[58381]: netconf id=21 got rpc: {urn:ietf:params:xml:ns:netconf:base:1.0}edit-config attrs: message-id="1"
<INFO> **23-Aug-2022::06:42:54.536** confd[58381]: netconf id=21 edit-config target=running attrs: message-id="1"
<INFO> **23-Aug-2022::06:45:04.592** confd[58381]: netconf id=21 sending rpc-reply, attrs: message-id="1"
<INFO> 23-Aug-2022::06:45:04.615 confd[58381]: netconf id=21 ssh transport closed
<INFO> 23-Aug-2022::06:45:04.616 confd[58381]: netconf id=22 ssh transport closed
Please suggest how to improve the config XML load performance.