Outils pour utilisateurs

Outils du site


Table des matières


Serveur HTTP.



Tips & Tricks

How To Optimize Nginx Configuration


user www-data www-data;
# Nginx can have more than one worker process running at the same time.
# To take advantage of SMP and to enable good efficiency I would recommend changing this to read:
worker_processes  4;
events {
    worker_connections  1024;
http {
    tcp_nodelay        on;
	include /usr/local/nginx/sites-enabled/*;

Sets the number of connections that each worker can handle. This is a good default setting.

You can work out the maximum clients value from this and the worker_processes settings:

max_clients = worker_processes * worker_connections

Sendfile is used when the server (Nginx) can actually ignore the contents of the file it is sending. It uses the kernel sendfile support instead of using it's own resources on the request.

It is generally used for larger files (such as images) which do not need use of a multiple request/confirmation system to be served - thus freeing resources for items that do need that level of 'supervision' from Nginx.

Keep it an on unless you know why you need to turn it off.

informatique/nginx.txt · Dernière modification: 14/01/2017 15:19 par cyrille