Please help with optimization

Piki nginx-forum at
Thu Oct 4 17:12:34 UTC 2012

My best suggestion would be to look through your nginx and php settings to
limit the amount of persistent connections and total connections (both to
mysql and to your site(s)). The more persistent connections there are, the
more processes on your server and web browsers accessing the site will be
able to maintain a single connection each, so limitting those will force it
to cut off anything inactive or taking too long when it reaches that limit.

Unfortunately I don't have the experience to come clsoe to suggesting good
values for you. My best advice would be to check for general recommendations
on Google et al., then pick what you feel is safe and adjust over time until
you feel you hit the right values.

Another option would be to enable gzip within nginx, (add "gzip on;" without
quotes to nginx.conf), then use Google to research what browsers don't
support gzip. You can blacklist those browser by adding something similar

gzip_disable "msie6";

to nginx.conf, placing all the browser UA strings within  quotes. That way,
nginx will automatically use gzip compression for browsers that are not
blacklisted, which will save bandwidth. There are also various options you
can add to nginx.conf (I think the default has them commented out by
default) to tweak this further.

There are plenty of other things you can do to optimize things, most of
which you can find quite easily in the nginx wiki and via Google et al.
Search for things like "nginx optimization", "nginx and php-fpm
optimization", and "nginx and php-fpm and mysql optimization".

Posted at Nginx Forum:,231369,231391#msg-231391

More information about the nginx mailing list