The web server is the front door of every request. A well-configured one serves static files and cached pages with negligible CPU, terminates TLS efficiently, keeps connections open sensibly and protects the application behind it. This guide covers the settings that make the biggest difference on an EPYC VPS, explains why each one matters and shows how to check the result.
Workers and Connections
# /etc/nginx/nginx.conf
user www-data;
worker_processes auto; # one per vCore
worker_rlimit_nofile 65535;
events {
worker_connections 8192;
multi_accept on;
}
worker_processes auto starts one worker per vCore, and each worker handles thousands of connections with an event loop. Raise the open-file limit to match: each connection, and each proxied upstream connection, uses a file descriptor. If Nginx runs under systemd, also set LimitNOFILE=65535 in an override (systemctl edit nginx).
HTTP/2 and HTTP/3
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on; # Nginx 1.25.1+; older versions: "listen 443 ssl http2;"
# HTTP/3 (QUIC) needs an Nginx build with HTTP/3 support:
# listen 443 quic reuseport;
# add_header Alt-Svc 'h3=":443"; ma=86400';
...
}
HTTP/2 multiplexes many requests over one connection, which reduces latency for pages with many assets. HTTP/3 runs over QUIC (UDP) and helps on lossy mobile networks; enable it only with a build that supports it and open UDP 443 in the firewall.
TLS Performance
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
TLS 1.3 needs one fewer round trip than older versions. A shared session cache lets returning visitors resume sessions without a full handshake, which saves CPU on busy servers. ECDSA certificates (Certbot's default for new certificates) are faster to handshake than RSA. Modern EPYC cores accelerate AES and SHA in hardware, so encryption overhead per request is small; full handshakes are the expensive part, which session resumption and keep-alive reduce. If you staple OCSP responses, make sure your certificate supports it, as some certificate authorities have been phasing OCSP out.
Compression
gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_types text/css application/javascript application/json image/svg+xml text/plain application/xml;
# Brotli (needs the ngx_brotli module):
# brotli on; brotli_comp_level 5; brotli_types ...;
Compress text, not images or video, which are already compressed. Level 5 balances CPU and size; for static assets, pre-compress at build time (.br and .gz files) and serve them with gzip_static on; so no CPU is spent per request.
Static File Delivery
sendfile on;
tcp_nopush on;
tcp_nodelay on;
open_file_cache max=10000 inactive=60s;
open_file_cache_valid 120s;
location ~* \.(?:css|js|woff2|webp|avif|png|jpg|svg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
sendfile sends files from the kernel without copying them through Nginx; open_file_cache avoids repeated file lookups. Versioned filenames make one-year caching safe.
Keep-Alive and Timeouts
keepalive_timeout 30s;
keepalive_requests 1000;
client_body_timeout 15s;
client_header_timeout 15s;
send_timeout 15s;
Keep-alive reuses connections for many requests; reasonable timeouts stop slow or idle clients from holding resources. For upstream applications, enable connection reuse with an upstream block and keepalive 32;, plus proxy_http_version 1.1; and proxy_set_header Connection "";.
Caching Dynamic Content
The biggest performance gain for dynamic sites is not serving them dynamically. FastCGI or proxy caching lets Nginx answer repeat requests from memory and disk without touching PHP or Node.js. Use fastcgi_cache_lock to prevent stampedes and fastcgi_cache_use_stale to serve stale pages if the backend fails (see our high-traffic guide).
Kernel Network Tuning
# /etc/sysctl.d/90-web.conf
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_fin_timeout = 15
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
Apply with sudo sysctl --system. A larger backlog prevents dropped connections during bursts; a wider local port range helps when Nginx makes many upstream connections; BBR often improves throughput for distant clients. Change one thing at a time and measure.
Logging Without Slowing Down
Access logs cost disk I/O on every request. Buffer them (access_log /var/log/nginx/access.log main buffer=64k flush=5s;), disable logging for static assets and health checks, and include $request_time and $upstream_response_time in the format so logs are useful for performance analysis.
Measure the Result
- Load test realistic traffic with k6 and compare p95 latency before and after changes (see our k6 guide).
- Check HTTP/2 and compression with your browser's developer tools (Protocol and Content-Encoding columns).
- Check TLS settings with an online TLS test.
- Watch CPU per worker under load; if Nginx itself is busy, look at TLS handshakes and compression levels.
Nginx, Caddy or Apache?
Nginx is the most common high-performance choice. Caddy offers automatic HTTPS with simpler configuration and good performance. Apache with the event MPM performs well too, and is the natural choice when applications rely on .htaccess files; many setups put Nginx in front of Apache for static files and caching (see our Nginx and Apache guide).
Where to Start
If you only have an hour, change things in this order, because each step usually gives more than the next: enable caching for dynamic pages; add long cache headers and compression for static assets; enable HTTP/2 and TLS session resumption; raise worker connections and file limits; then tune the kernel. Measure after each step so you know which changes helped and can undo any that did not.
Reload Safely
Always test configuration before applying it with sudo nginx -t, then use sudo systemctl reload nginx, which starts new workers with the new configuration while old workers finish their requests. A restart drops connections; a reload does not. Keep your configuration in Git so a bad change can be reverted in seconds.
Common Mistakes
- Compressing images and video, which wastes CPU for no gain.
- Caching
index.htmlor HTML for a long time, so users do not see new releases. - Logging every static asset request on busy sites.
- Raising worker counts far beyond the vCore count, which adds context switching rather than throughput.
- Copying kernel tuning from the internet without measuring before and after.
SkyRainCloud Plans for This Workload
Nginx itself is light: even 2 vCores serve many thousands of static or cached requests per second. Size the plan for what sits behind it (PHP, Node.js, the database) and use larger tiers when TLS handshakes and dynamic pages dominate.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.