nova/nova/api
Matt Riedemann 66e44c6429 Only construct SchedulerReportClient on first access from API
With commit 5d1a500185 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).

Change-Id: Idf6e548d725db0181629a451f46b6a3a5850d186
Closes-Bug: #1807219
2018-12-12 12:25:18 -05:00
..
ec2 delete more i18n log markers 2017-03-21 07:37:21 -04:00
metadata metadata: add vf_trusted field to device metadata 2018-05-31 13:55:10 -04:00
openstack Only construct SchedulerReportClient on first access from API 2018-12-12 12:25:18 -05:00
validation Fix deprecated base64.decodestring warning 2018-10-15 00:41:44 +00:00
__init__.py Remove unused copyright from nova.api.__init__ 2014-01-10 16:24:50 +08:00
auth.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00
compute_req_id.py Migrate to oslo request_id middleware - mv 2.46 2017-05-27 10:11:44 +00:00
manager.py Only setup iptables for metadata if using nova-net 2017-07-20 00:00:22 +00:00
wsgi.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00