|
|
|
|
|
by getsat
5579 days ago
|
|
Preforked and threaded blocking IO consumes far more resources than event-driven non-blocking network IO. Process/thread stacks consume a significant amount of memory. This is why nginx ruins Apache at almost anything at scale (especially reverse proxying). Apache falls over while consuming grandiose amounts of memory in the low millions of connections per day while nginx can easily handle 10mm connections per day on a single core machine with 256mb ram. It's ridiculous. On the other hand, for long-lived connections, you're better off using blocking IO since it's more efficient. Most web traffic is not long-lived, though. See Paul's interesting article on NIO vs IO performance: http://mailinator.blogspot.com/2008/02/kill-myth-please-nio-... http://www.mailinator.com/tymaPaulMultithreaded.pdf And don't forget about Slowloris. If you see your competition using Apache, you really don't need to worry. :) Disclaimer: I have nothing personal against Apache and used it for six years or so. I've just moved on to better software. If it works for you, that's great. |
|
Also, a properly configured Varnish placed in front of Apache ruins Nginx at almost anything at scale. I've seen it.
But most web traffic is blocking. Going NIO requires caching - which is a huge penalty and a PITA; and doing it while not having actual users doesn't make sense.