commit 66e44c64297e77395195d77104017fb6fcea58d2
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 6 11:17:15 2018 -0500
Only construct SchedulerReportClient on first access from API
With commit 5d1a50018510b2b281ad33895ae2d9555f5d5b05 each
API/AggregateAPI class instance constructs a SchedulerReportClient
which holds an in-memory lock during its initialization.
With at least 34 API extensions constructing at least
one of those two API classes, the accumulated affect of the
SchedulerReportClient construction can slow down nova-api startup
times, especially when running with multiple API workers, like
in our tempest-full CI job (there are 2 workers, so 68 inits).
This change simply defers constructing the SchedulerReportClient
until it is used, which is only in a few spots in the API code,
which should help with nova-api start times.
The AggregateAPI also has to construct the SchedulerQueryClient
separately because SchedulerClient creates both the query and
report clients.
Long-term we could consider making it a singleton in nova.compute.api
if that is safe (the aggregate code might be relying on some caching
aspects in the SchedulerReportClient).
Reviewed: https:/ /review. openstack. org/623246 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=66e44c64297 e77395195d77104 017fb6fcea58d2
Committed: https:/
Submitter: Zuul
Branch: master
commit 66e44c64297e773 95195d77104017f b6fcea58d2
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 6 11:17:15 2018 -0500
Only construct SchedulerReport Client on first access from API
With commit 5d1a50018510b2b 281ad33895ae2d9 555f5d5b05 each AggregateAPI class instance constructs a SchedulerReport Client
API/
which holds an in-memory lock during its initialization.
With at least 34 API extensions constructing at least portClient construction can slow down nova-api startup
one of those two API classes, the accumulated affect of the
SchedulerRe
times, especially when running with multiple API workers, like
in our tempest-full CI job (there are 2 workers, so 68 inits).
This change simply defers constructing the SchedulerReport Client
until it is used, which is only in a few spots in the API code,
which should help with nova-api start times.
The AggregateAPI also has to construct the SchedulerQueryC lient
separately because SchedulerClient creates both the query and
report clients.
Long-term we could consider making it a singleton in nova.compute.api Client) .
if that is safe (the aggregate code might be relying on some caching
aspects in the SchedulerReport
Change-Id: Idf6e548d725db0 181629a451f46b6 a3a5850d186
Closes-Bug: #1807219