Too many reconnections to the SQLalchemy engine
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Invalid
|
Undecided
|
Unassigned | ||
oslo.db |
Invalid
|
Medium
|
Unassigned |
Bug Description
=== Issue Description ===
It looks like for every DB request oslo.db is reconnecting to the SQLalchemy engine, that leads to "SELECT 1" request to the database per every meaningful request.
=== Prelude(
I was testing osprofiler library (OpenStack profiler) changes, that are currently on review for Nova, Neutron and Keystone + OSprofiler integration, trying to perform nova-boot requests. After generating the trace for this request, I got the following html report: https:/
I ensured that all of these requests are coming from this method via adding _connect_
These "SELECT 1"s are in fact spending 1/3 of all time SQLalchemy engine in oslo.db is spending on all requests. This seems to be a bug.
=== Env description & spets to reproduce ===
I have devstack environment with latest 1.1.0 osprofiler installed. To install profiler on the devstack env I used the following additions to the local.conf:
enable_plugin ceilometer https:/
enable_plugin osprofiler https:/
Additionally I've used the following changes:
- Nova: https:/
- Nova client: https:/
- Neutron: https:/
- Neutron client: https:/
- Keystone: https:/
Also I've modified standard keystone.conf to turn memcache caching:
[cache]
memcache_servers = 127.0.0.1:11211
backend = oslo_cache.
enabled = True
Then you can simply run nova --profile SECRET_KEY boot --image <image_id> --flavor 42 vm1 to generate all notifications and then osprofiler trace show --html <trace_id> --out nova-boot.html using the trace id printed in the bottom of nova boot output.
Changed in oslo.db: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in oslo.db: | |
status: | Confirmed → Invalid |
"SELECT 1" is emitted on every pool checkout and does not correspond to an actual new database connection. are you just seeing the "SELECT 1" or are you also seeing many new TCP connections?