sqlalchemy connection pool limit reached which causes overflow connection timeout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
New
|
Undecided
|
Unassigned | ||
OpenStack Compute (nova) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
From time to time we get this error:
Still trying to figure out how connections are returned to the pool, I see that calling session close will do it, but there must be another way cause session.close is not called at all in nova.db.
QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30 Which causes the api operation to fail.
Here is an example:
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack return IMPL.compute_
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack return _compute_
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack options(
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack ret = list(self[0:1])
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack return list(res)
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack return self._execute_
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack close_with_
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack **kw)
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack close_with_
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack return engine.
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack self.pool.
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack return _ConnectionFair
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack rec = self._connectio
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack File "/usr/lib64/
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack (self.size(), self.overflow(), self._timeout))
2013-05-07 14:07:16.429 9049 TRACE nova.api.openstack TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30
Here is another example:
File "/usr/lib/
self.security_
File "/usr/lib/
existed, group = self.db.
File "/usr/lib/
return IMPL.security_
File "/usr/lib/
columns_to_join=[], session=session)
File "/usr/lib/
return f(*args, **kwargs)
File "/usr/lib/
result = query.first()
File "/usr/lib64/
ret = list(self[0:1])
File "/usr/lib64/
return list(res)
File "/usr/lib64/
return self._execute_
File "/usr/lib64/
close_with_
File "/usr/lib64/
**kw)
File "/usr/lib64/
close_with_
File "/usr/lib64/
return engine.
File "/usr/lib64/
self.pool.
File "/usr/lib64/
return _ConnectionFair
File "/usr/lib64/
rec = self._connectio
File "/usr/lib64/
(self.size(), self.overflow(), self._timeout))
TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30
tags: | added: db |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
it may be too many requests for db access at the same time.
The TimeoutError "QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30" means:
pool size: 5
overflow: 10
timeout: 30
The current connections reached 15 (5+10). The new request will wait 30 seconds (timeout) to acquire connection from the pool or raise the TimeoutError.
setting the flag sql_max_overflow to -1 or larger than 10 might solve this problem.