[CONTROLLER-426] Performance Issue: Inefficient implementation of readOperationalData method. Created: 29/Apr/14  Updated: 25/Jul/23  Resolved: 15/May/14

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Norman Traxler Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


Attachments: PNG File MD-salmodePerfIssuegetNodeConnectors.png    
External issue ID: 902

 Description   

I have an ODL controller running with 198 nodes; each node with 104 NodeConnectors.

My code queries each of the 198 nodes for the nodeConnectors using the following code:

public static List<NodeConnector> getNodeConnectors(DataProviderService dps, String nodeId) {

// Create a Type-safe reader so that casting isn't necessary.
TypeSafeDataReader reader = TypeSafeDataReader.forReader(dps);

// Create the inventory node Id key:
NodeId inventoryNodeId = new NodeId(nodeId);
NodeKey inventoryNodeKey = new NodeKey(inventoryNodeId);

// Get the child node Id:
InstanceIdentifierBuilder<Node> nodeChild = InstanceIdentifier.builder(Nodes.class).child(Node.class,
inventoryNodeKey);
InstanceIdentifier<Node> nodePath = nodeChild.toInstance();

// Read the node from the Operational Data store:
Node node = reader.readOperationalData(nodePath);

if (node == null)

{ throw new RuntimeException("MD-SAL Node not found for nodeId:" + nodeId); }

return node.getNodeConnector();
}

This takes about 12 seconds to run on a standard Windows desktop.

An Analysis of the CPU performance using JProfiler shows a very high number of calls to SchemaAwareDataStoreAdapter$MergeFirstLevelReader$2.apply, with the bulk of CPU time spent in this method (specifically Map.equals).

See attachment for screen snapshot of the JProfiler analysis.

For any questions, feel free to contact.



 Comments   
Comment by Norman Traxler [ 29/Apr/14 ]

Attachment MD-salmodePerfIssuegetNodeConnectors.png has been added with description: JProfiler screen snapshot of performance bottleneck.

Comment by Norman Traxler [ 15/May/14 ]

Picked up changes May 6 that have resolved the issue (due to bug fix 499).

Generated at Wed Feb 07 19:52:59 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.