AccueilGlossaire › Nginx Performance Tuning

Nginx Performance Tuning

Linux

Configurations Nginx optimisant performance pour haute charge.

Nginx Performance Tuning regroupe les configurations optimisant Nginx (web server / reverse proxy) pour haute charge. Nginx est célèbre pour gérer 10k+ connexions concurrent par worker grâce à event-driven architecture, mais defaults conservatifs — tuning unlock potential.

Paramètres clés nginx.conf :
(1) **worker_processes auto** — un worker par CPU core (avant manuel = N CPUs).
(2) **worker_connections 10240** — max connections per worker (default 768 trop bas).
(3) **worker_rlimit_nofile 65535** — file descriptors limit per worker.
(4) **use epoll** sur Linux (auto-détecté généralement).
(5) **multi_accept on** — accept multiple connexions par event loop iteration.
(6) **keepalive_timeout 65** — keep-alive durée.
(7) **keepalive_requests 1000** — max requests par keepalive connection.
(8) **sendfile on** — kernel zero-copy file serving.
(9) **tcp_nopush on** + **tcp_nodelay on** — optimize TCP packet behavior.
(10) **gzip on** + **gzip_comp_level 5** + **gzip_types** appropriés — compress responses.
(11) **client_body_buffer_size 16k**, **client_max_body_size 100m** selon use case.
(12) **open_file_cache** — cache file metadata.
(13) **proxy_buffering on** + **proxy_buffers 16 16k**.

Upstream tuning : (1) **keepalive 32** dans upstream block — pooled connections to backends ; (2) **proxy_http_version 1.1** + **proxy_set_header Connection ""** pour activer keepalive ; (3) **upstream load balancing methods** : round-robin (default), least_conn, ip_hash.

OS-level : (1) `ulimit -n 65535` user nginx ; (2) sysctl `net.core.somaxconn=65535`, `net.ipv4.tcp_max_syn_backlog=65535` ; (3) `net.ipv4.ip_local_port_range=1024 65535` ; (4) BBR congestion control.

Monitoring : nginx_status module (basic), Nginx Plus extended metrics, Prometheus nginx exporters, VTS module. Load testing : wrk, k6, ApacheBench, Gatling pour valider tuning. Compétences LFCE, RHCE.

Certifications qui couvrent ce concept
RHCSA LFCS
Termes liés
Load Balancer (Répartiteur de charge) PHP-FPM Tuning

Préparez vos certifications IT gratuitement

200+ certifications, 400 000+ questions, examens blancs chronométrés.

Voir le catalogue →
← Retour au glossaire