A big thank you and a couple of questions about performance

Igor Sysoev is at rambler-co.ru
Thu Jan 18 10:06:51 MSK 2007


On Wed, 17 Jan 2007, [UTF-8] ?ime Ramov wrote:

> I just configured Debian Sarge box for serving Django sites with
> Python 2.5, psyco, SQLite 3, nginx 0.5.7, and Django SVN and I could
> not be happier. Just a big big thanks to developers, nginx is really
> amazing.
>
> Now, on to the questions. The speed is *amazing*, really. And that's
> without *any* modifications. I just used default config file and
> adjusted slightly in order to serve Django.
>
> Now, I was wondering, what optimizations can I make to make it even faster?
>
> This is my config file, kernel is 2.4 on Debian Sarge:
> http://dpaste.com/hold/4771/

You may increase number and size of FastCGI buffers:

       fastcgi_buffer_size  8k;
       fastcgi_buffers      32 8k;

> As you can see, it serves static files while redirecting dynamic stuff
> to FastCGI server...
>
> I'm just interested in pure performance, bandwidth saving isn't a big
> deal because I will have just low traffic sites... Thanks.

You should add static location for /nginx-errors/50x.html:

     error_page   500 502 503 504  /nginx-errors/50x.html;
     location = /nginx-errors/50x.html {
         alias /some/path/50x.html;
     }

The 502 and 504 errors aries when working with FastCGI and they should
be static pages. But now /nginx-errors/50x.html will be routed to FastCGI
via "location /".

You may enable "tcp_nopush  on;" and delete "tcp_nodelay  on;" (it's on
by default, I will delete it from example configuration in next release).


Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list