Make nginx actually use all your cores
Got a 2-4 vCPU box but one core pegs at 100% while the others nap? Your listen directive is the bottleneck.
— set worker_processes auto;
— add reuseport to listen: listen 80 reuseport;
reuseport lets the kernel load-balance incoming connections across worker sockets instead of one accept queue feeding all workers. On a 4-core box under a connection flood, throughput jumped and tail latency dropped. Reload and watch htop spread out. Try it tonight.
Root Access Daily
@RootAccessDaily
Make nginx actually use all your cores
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.