add_instance_node during nova CDM build performance issue when listing servers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
watcher |
Fix Released
|
High
|
chenker | ||
Stein |
Fix Released
|
High
|
Matt Riedemann |
Bug Description
https:/
This introduced a performance regression when the number of servers on a given host is small, for example 4 servers on a host.
The problem is that watcher is passing limit=-1 to novaclient when listing servers which will always make at least two API calls to be sure it's done paging:
https:/
If we can determine before we list servers that there are only a certain number - 4 in this example - we should just pass the limit=len(servers) to novaclient and avoid the second call for paging which takes extra time and yields no results.
It's worth noting that by default the compute API will return a max of 1000 servers:
https:/
But in this case when we're filtering by host, there should be far less (non-baremetal) servers on the compute service host in this case and we shouldn't reach that max limit (and the nova CDM builder code does not support ironic baremetal nodes so we can assume we don't have to account for that wrinkle where a single nova-compute service is managing more than 1000 ironic nodes).
chenker has a patch started here: https:/ /review. opendev. org/#/c/ 668100/