Boost Nginx Throughput 3×: 5 Essential Performance Tuning Parameters

This article explains how to dramatically improve Nginx performance in high‑concurrency scenarios by configuring five crucial parameters—worker_processes, worker_connections, epoll, sendfile/TCP optimizations, and keepalive—complete with code examples and expected impact.

Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Boost Nginx Throughput 3×: 5 Essential Performance Tuning Parameters

Nginx is a core component of large‑scale architectures, and its performance often becomes the first bottleneck under high concurrency.

Five Key Tuning Parameters

worker_processes : Utilizes multiple CPU cores. Set to the number of cores, e.g., worker_processes auto; This raises CPU utilization from ~20% to 90% and increases throughput by about 1.5×.

worker_connections : Increases the maximum concurrent connections per worker. Example configuration:

events {
    worker_connections 65535;
}

The theoretical maximum connections equal worker_processes * worker_connections. Adjust ulimit -n accordingly to avoid "Too many open files" errors, yielding a ten‑fold increase in concurrent connections.

epoll : Enables Linux's high‑performance I/O multiplexing. Add to the events block:

events {
    use epoll;
}

Compared to select/poll (O(n)), epoll operates in O(1), cutting CPU usage by ~50% and reducing latency under heavy load.

sendfile & TCP optimizations : Zero‑copy file transmission and TCP tweaks improve I/O throughput.

sendfile on;
    tcp_nopush on;
    tcp_nodelay on;

These settings boost file transfer performance by ~30% and lower latency by ~15%.

keepalive optimization : Adjusts idle connection timeout and request limit.

keepalive_timeout 30s;
    keepalive_requests 1000;

Shortening idle time frees resources, while increasing request count per connection reduces handshake overhead.

Applying these configurations can increase overall Nginx throughput by more than 300% in typical high‑traffic environments.

Nginx performance optimization: master these 5 parameters for a 300% boost
Nginx performance optimization: master these 5 parameters for a 300% boost
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

configurationPerformance Tuningserver optimization
Mike Chen's Internet Architecture
Written by

Mike Chen's Internet Architecture

Over ten years of BAT architecture experience, shared generously!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.