sblantipodi wrote:
glg wrote:
His example was only one line. Yes, you have 30 lines (MaxClients), but also potentially hundreds waiting in line. If you have 20-25 of those lines fumbling with their credit cards or worse "can I write a check?" (Keepalive timeout too high), then suddenly only a handful of your lines are moving.
be real...

Every analogy breaks down at some point...
In real life, it's unlikely that every customer in every cashier will try to use an expired credit card or offer to write a check. But in computing, if you allow something to happen, it
will happen sooner or later. Especially if the reason you're allowing it in the first place is to accommodate clients who actually need it badly.
How long does it take for a mobile client to open a connection, make the first request, receive the first response, process it, make the second request, receive the second response, and finally close the connection? Let's be generous and say 20 seconds. If so, each and every client is holding up a line for 20 seconds, regardless of how long it actually takes for the server to process their requests. Every single client walks up to the cashier, puts down a bunch of stuff, realizes that it forgot the milk, and tells the cashier to wait while they get milk! Unfortunately, Apache with mpm_prefork isn't smart enough to let another client through while the first client is getting milk. That's what nginx is for.
If your setup works fine with MaxClients 30, it's only because there are never more than 30 clients trying to connect in any 20-second interval. If you sell enough apps to get 31 clients in a 20-second interval, the 31st client will have to wait 20 seconds before it can even make the first request, because all of the 30 lines are being held up by milk-forgetters. Sooner or later, you'll end up with a client that needs to wait 40 seconds. But not many clients will wait 40 seconds. They'll just timeout, making it look like your site is down.
This doesn't need to be fixed right away, but it's worth remembering if you expect more clients in the future. Switching to nginx often gives you an incredible speed boost, simply because nginx manages client connections much more efficiently than Apache's old-fashioned mpm_prefork. nginx is very smart. If a client so much as fumbles with one credit card, nginx will process a couple of other clients in the meantime.
KeepAlive is safe to use with nginx, but not with Apache.
Edit: remember the milk reference.