accept() failed (53: Software caused connection abort)

Maxim Dounin mdounin at mdounin.ru
Wed Jul 13 18:22:13 MSD 2011


Hello!

On Wed, Jul 13, 2011 at 04:10:52PM +0200, Adam PAPAI wrote:

> Maxim Dounin wrote:
> >Hello!
> >
> 
> >Maxqlen is maximum listen socket queue length (the queue of
> >connections completed handshake but not yet accept()'ed by
> >application), and FreeBSD will reset new connections if it's
> >exhausted (or will just drop them if you have
> >net.inet.tcp.syncache.rst_on_sock_fail=0).
> >
> >If you see qlen greater than maxqlen it means that your app can't
> >cope with load.  If this happens for a fraction of a second due to
> >connection bursts - this may be ok and you just need to increase
> >queue length to compensate bursts.
> 
> The question is now: how to increase the queue length under FreeBSD.
> I cannot find the config value in sysctl.

System limit is kern.ipc.somaxconn.  But as far as I remember you 
have 4096 queue for nginx, so it looks like you've already tuned 
it. :)

The question is how to tune it in your backend, but there is no 
simple answer: this depends on backend.  E.g. php-fpm should use 
kern.ipc.somaxconn as seen on process startup by default and have 
an option ("backlog") to tune it.

But again: as long as you've been able to see overflows, just 
increasing listen queue isn't likely to help.  You have to add 
more backends.

Maxim Dounin



More information about the nginx mailing list