Hacker News new | ask | show | jobs
by randomtree 4674 days ago
If I remember correctly the details of why Nginx might be better at handling massive amount of clients is that it has event-driven architecture.

If you consider a slow client that consumes 1mb of html in, say, half a minute, an Apache thread(2.0)/process serving him would be effectively locked during this time. And thread/process has a relatively big overhead, both memory and cpu wise. Nginx, on the other hand, would just switch to serving the next client/clients, whos socket is ready (using epoll/select).

1 comments

Apache has had mpm_worker since the 2.2 days, and now (2.4) has mpm_event, which uses epoll too.