Nginx fails to accept new connection if active worker crashes

Andrew Alexeev andrew at
Tue Nov 15 13:26:11 UTC 2011

On Nov 15, 2011, at 3:37 PM, faskiri.devel wrote:

> Hi Andrew
> Thanks for the prompt reply.
> As a temporary fix I had created a variable in the shared memory to
> track which pid is holding the mutex so that the check in
> []
> works. It works fine for me, hadnt realized I could switch it off. Are
> we talking about putting "accept_mutex off" in the nginx.conf file? It
> will be great if you could explain what that will actually do, as in,
> how will the new requests be handed off to workers.

Yes, accept_mutex off. What accept mutex does is trying to prevent workers from competing over accept from listening sockets (in the kernel). In other words, without accept mutex workers may try to simultaneously check for new events on sockets which may lead to a slight increase in CPU usage.

Depending on your OS and the event notification mechanisms the results may vary.

Actually it's quite safe to try it and we'd appreciate your feedback here!

And as I mentioned, we've been working on fixing the situation with crashed workers and mutex lock-ups.

> Best Regards
> +Fasih
> Posted at Nginx Forum:,218359,218373#msg-218373
> _______________________________________________
> nginx mailing list
> nginx at

More information about the nginx mailing list