<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 6:39 AM, Clayton O'Neill <span dir="ltr"><<a href="mailto:clayton@oneill.net" target="_blank">clayton@oneill.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Thu, Jan 7, 2016 at 2:49 AM, Roman Podoliaka <<a href="mailto:rpodolyaka@mirantis.com">rpodolyaka@mirantis.com</a>> wrote:<br>
><br>
> Linux gurus please correct me here, but my understanding is that Linux<br>
> kernel queues up to $backlog number of connections *per socket*. In<br>
> our case child processes inherited the FD of the socket, so they will<br>
> accept() connections from the same queue in the kernel, i.e. the<br>
> backlog value is for *all* child processes, not *per* process.<br>
<br>
<br>
</span>Yes, it will be shared across all children.<br>
<span class=""><br>
><br>
> In each child process eventlet WSGI server calls accept() in a loop to<br>
> get a client socket from the kernel and then puts into a greenlet from<br>
> a pool for processing:<br>
<br>
</span>It’s worse than that.  What I’ve seen (via strace) is that eventlet actually<br>
converts socket into a non-blocking socket, then converts that accept() into a<br>
epoll()/accept() pair in every child.  Then when a connection comes in, every<br>
child process wakes up out of poll and races to try to accept on the the<br>
non-blocking socket, and all but one of them fails.<br>
<br>
This means that every time there is a request, every child process is woken<br>
up, scheduled on CPU and then put back to sleep.  This is one of the<br>
reasons we’re (slowly) moving to uWSGI.<br>
<div class=""><div class="h5"><br></div></div></blockquote><div><br></div><div>I just want to note that I've got a change proposed to devstack that adds a config option to run keystone in uwsgi (rather than under eventlet or in apache httpd mod_wsgi), see <a href="https://review.openstack.org/#/c/257571/">https://review.openstack.org/#/c/257571/</a> . It's specific to keystone since I didn't think other projects were moving away from eventlet, too.<br><br></div><div>- Brant<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>