[openstack-dev] [nova] [all] Excessively high greenlet default + excessively low connection pool defaults leads to connection pool latency, timeout errors, idle database connections / workers

Chris Friesen chris.friesen at windriver.com
Fri Jan 8 10:32:21 UTC 2016

On 01/07/2016 09:49 AM, Roman Podoliaka wrote:
> Actually we already do that in the parent process. The parent process:
> 1) starts and creates a socket
> 2) binds the socket and calls listen() on it passing the backlog value
> (http://linux.die.net/man/2/listen)
> 3) passes the socket to the eventlet WSGI server
> (https://github.com/openstack/oslo.service/blob/master/oslo_service/wsgi.py#L177-L192)
> 4) forks $*_workers times (child processes inherit all open file
> descriptors including the socket one)
> 5) child processes call accept() in a loop
> Linux gurus please correct me here, but my understanding is that Linux
> kernel queues up to $backlog number of connections *per socket*. In
> our case child processes inherited the FD of the socket, so they will
> accept() connections from the same queue in the kernel, i.e. the
> backlog value is for *all* child processes, not *per* process.

I believe this is correct, the limit is on the (shared) socket and not the 
individual processes.

Also, an interesting point from the listen man page above:

"If the backlog argument is greater than the value in 
/proc/sys/net/core/somaxconn, then it is silently truncated to that value; the 
default value in this file is 128."


More information about the OpenStack-dev mailing list