You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nginx uses a fixed number of workers, each of which handles incoming requests.
The general rule of thumb is that you should have one worker for each CPU-core your server contains.
Count CPUs available
grep ^processor /proc/cpuinfo | wc -l
Maximum number of connections = worker_processes * worker_connections
# One worker per CPU-core.
worker_processes
# Specifies how many connections each worker process can handle.
worker_connections
# Causes nginx to attempt to immediately accept as many connections as it can, subject to the kernel socket setup.
# Recommend to use epoll. Epoll event-model is generally recommended for best throughput.
multi_accept = epoll;
Remove server header on HTTP Request
server_tokens off;
Enable gzip - compression
Gzip involves the trade-off common to tuning, performing the compression takes CPU resources from your server, which frequently means that you'd be better off not enabling it at all.
Generally the best approach with compression is to only enable it for large files, and to avoid compressing things that are unlikely to be reduced in size (such as images, executables, and similar binary files).