Welcome! Log In Create A New Profile

Advanced

Tuning workers and connections

Avleen Vig
July 01, 2009 09:23PM
Hi folks, I have some questions about tuning nginx for best
performance, on a site which handle ~1000 requests per second.

In our config, we have:

worker_processes 16;
worker_rlimit_nofile 32768;
events {
worker_connections 8192;
}

This is on a server with 8 CPU cores and 8Gb RAM.
My understanding is that this should allow nginx to establish up to
32k network connections, because that is the limit of
worker_rlimit_nofile. We serve very few files off the disk, maybe a
dozen CSS and JS files. Everything else is handed to backends using
proxy_pass.
So with one fd for the browser, and one fd to the upstream, we should
be able to handle 16k concurrent connections.

However what we're seeing, is that around 5k connections we get a
performance hit. Connections slow down, take longer to establish, etc.
The load on the box is almost zero, nginx is clearly working very fast
and efficiently, but I'm not sure why it slows down.
Any thoughts?


Also, I'm thinking about enabling the multi_accept option, but I
couldn't find much documentation on how this works.
It sounds like a high-performance tweak which we should be using if we
get this many requests per second.
Could it be that not using multi_accept is the problem?
Nginx otherwise has to handle the incoming connection requests in
serial and this is a bottleneck?


Thanks :)
Subject Author Posted

Tuning workers and connections

Avleen Vig July 01, 2009 09:23PM

Re: Tuning workers and connections

Gabriel Ramuglia July 01, 2009 10:39PM

Re: Tuning workers and connections

Dave Cheney July 02, 2009 01:43AM

Re: Tuning workers and connections

Avleen Vig July 02, 2009 09:58AM

Re: Tuning workers and connections

Maxim Dounin July 02, 2009 05:56AM

Re: Tuning workers and connections

Avleen Vig July 02, 2009 10:01AM

Re: Tuning workers and connections

mike July 02, 2009 01:56PM

Re: Tuning workers and connections

Maxim Dounin July 02, 2009 02:19PM

Re: Tuning workers and connections

mike July 02, 2009 02:34PM

Re: Tuning workers and connections

Maxim Dounin July 02, 2009 03:05PM

Re: Tuning workers and connections

Momchil Ivanov July 03, 2009 04:58AM

Re: Tuning workers and connections

liangrubo August 21, 2012 03:23AM

Re: Tuning workers and connections

liangrubo August 21, 2012 03:48AM

Re: Tuning workers and connections

Stefan Caunter August 21, 2012 05:16AM

Re: Tuning workers and connections

hagai avrahami August 27, 2012 03:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 282
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready