ipdetecto.com logo
ipdetecto.com
My IPSpeed
Knowledge Hub
HomeKnowledge HubNginx Performance Tuning Guide
© 2026 ipdetecto.com
support@ipdetecto.comAboutContactPrivacyTermsllms.txt
Network Administration
5 MIN READ
Apr 19, 2026

Nginx Performance Tuning Guide

worker_processes, CPU pinning, sendfile, open_file_cache, upstream keepalive pools, and TLS session settings.

Throughput tuning balances CPU, open files, and upstream behavior. Align worker_processes with cores (often auto), enable sendfile and tcp_nopush for static files, and cache file metadata with open_file_cache. For upstream HTTP, reuse connections with keepalive in the upstream{} block and clear the Connection header on proxied requests. TLS cost drops when ssl_session_cache is sized sanely and tickets are rotated.

GoalKnobWatch for
Hot static assetsopen_file_cache + sendfileInode and cache churn on volatile trees
TLS handshakesssl_session_cache sharedMemory sizing vs hit rate
Upstream reusekeepalive + HTTP/1.1Pool size vs backend connection limits

Related

nginx configuration basics, reverse proxy, nginx SSL, nginx vs Apache

Frequently Asked Questions

Q.How many worker_processes should nginx use?

Often auto or one per CPU core is appropriate; validate with load tests because hyperthreading and TLS workloads change the ideal count.

Q.What does sendfile improve?

sendfile reduces copies between file descriptors when serving static content, which lowers CPU use for large file throughput.

Q.When should worker_connections be increased?

When bursts exhaust connection slots or you raise upstream concurrency; also raise OS nofile limits to match.

Q.Why use open_file_cache for static sites?

It caches file metadata and existence checks so nginx avoids repeated stat calls on hot paths.

Q.How do upstream keepalive connections help?

They reuse TCP connections to backends, cutting handshake overhead—pair with proxy_http_version 1.1 and cleared Connection headers.

Q.Why pair tcp_nopush with sendfile?

tcp_nopush can coalesce headers and data into fewer packets when used with sendfile on Linux.

Q.How does ssl_session_cache reduce CPU load?

It stores TLS session parameters so returning clients can resume sessions with fewer full handshakes.

Q.What is worker_rlimit_nofile used for?

It raises the per-worker open file limit so high concurrency does not fail when worker_connections grows.
TOPICS & TAGS
nginx tuningworker_processesopen_file_cachenginx performance