Nginx isn't as fast as i expect

seun.osewa at seun.osewa at
Thu Aug 16 16:00:55 MSD 2007

We have to specifically tell him to reduce the number of fastcgi
worker processes to something like 4, really.  Anything more than 4
fastcgi processes is too much with nginx as your front end.  two many
processes fill up the l2 cache with junk and kill performance, it's
not just swapping!  The primary advantage of nginx is that you can
handle more users with less processes.

On 8/16/07, Brice Figureau <brice+nginx at> wrote:
> On Thu, 2007-08-16 at 13:31 +0200, somebody nobody wrote:
> > A.  1 worker doesn't make any different when i test it,
> > B.   i must set sendfile off because in solaris sendfilev give me some
> > errors
> sendfile should work with tcp socket I guess, did you try ?
> > C.   Apache isn't running with Fastcgi and that why i am wondering why
> > nginx is slower
> So under apache you're using mod_php ?
> Is it:
>  1) the same PHP version in each case
>  2) do they use the same php.ini file (ie maybe you have a PHP opcode
> cache like APC or xcache on your apache's PHP version)
> > D.   spawn-fcgi -a -s /tmp/fastcgi.socket -u nobody -g
> > nogroup -C 250 -f /php/bin/php
> > E.   in apache i have 250 php processes too
> Depending on the spec of your server 250 must be too much.
> Apache usually spawns process on demand, so you might not reach more
> than 200 processes with the ab command you posted earlier.
> Spawn-cgi will spawns 250 processes whatever the real load is.
> Maybe at 250 processes your box is swapping, but not at 200...
> > F.   I did try a tcp socket and it gave me the same effect
> Can you check running apache with fastcgi in the same conditions to
> isolate who's the culprits (fastcgi communications, unix/tcp socket, php
> or the webserver in question).
> HTH,
> --
> Brice Figureau <brice+nginx at>

Seun Osewa [vast Nigerian forum]

More information about the nginx mailing list