Most of the time Apache spends in a thread is simply waiting, waiting, waiting.Performance degrades across the entire machine.Swap means that memory has to be dumped to the hard-drive temporarily.High memory usage leads the operating system into swap.These Apache threads suck up memory and slow down other threads.Those connections use a thread, and each thread loads all Apache modules.Apache holds connections open until they complete.Some reasons Apache has problems under load: To understand why we would want to do that we need to understand a bit about how nginx handles connections and resource usage compared to Apache. This could be used to load-balance your application servers, perhaps running Apache with mod_php. A request comes in to nginx and it will be forwarded along to other machines. It's basically a program that sits in front of other servers in your stack. Nginx is low-profile, event-driven web server that excels at serving multiple clients due to it's asynchronous nature. Here a few ways that people commonly use nginx: If you save processing on a database server that might need to analyze millions of records by pulling the results directly out of memory, you have created huge efficiency gains. Then you have things like network access, which in some cases is faster than disk depending on what they do. We also have swap situations which murder our performance, when the OS has to dump memory to disk to fill it up with new things constantly, and shuffle between them (overburden). RAID and disk cache speeds it up, but eventually things like fragmentation and load slow down access speeds. You could go SSD, but most systems are some type of spinning platter hard drive. Since we can't fit everything into CPU cache or RAM, we end up going with some sort of disk. In this post, I want to talk about some of the reasons you might want to go with this setup. For various reasons, nginx does a better job with memory and concurrent connection handling than Apache. This is becoming a very popular setup for many companies with non-trivial traffic, but I have also found success with it in my small 256MB Ram VPS. Instead of Apache, we use nginx with PHP-FPM to handle this traffic. We sell an educational product that serves a predictable 15,000 requests per minute for 10+ hours/day, every day. This all changed when I started work at my current job a few years ago.
I simply never had to deal with websites that got more than 10,000 visits a day. This has been the de facto standard for many PHP developers and for the most part I don't think any of that needs to change. When I started programming in PHP, my hosting setup involved a cPanel installation with Apache and MySQL.