Cloudflare

Why does one NGINX worker take all the load?

Oct 23, 2017Marek Majkowski
Why does one NGINX worker take all the load?
SummaryAI, from the source post

This post delves into the intricacies of load balancing in NGINX, specifically addressing the problem of uneven distribution of incoming connections across worker processes. It explains the different models for handling accept() calls, the Linux kernel's differing load balancing behaviors for blocking accept() vs. epoll-and-accept, and introduces SO_REUSEPORT as a solution for achieving more even load distribution. The post also highlights the critical trade-off between even load balancing and latency, demonstrating how SO_REUSEPORT can sometimes lead to degraded latency distributions under high load.

More from the Data Infrastructure & Analytics trail