I'm running a web server (apache, but I don't think there is really a difference), that serves a lot of requests to mobile devices (hundreds per second). The server is a mix of a pure web server with front end server for a J2EE app server (connecting through something like AJP).
What I notice is that I regularly have to increase the amount of Apache workers to keep up with the amount of requests. And when the bottleneck starts to happen, I see a large amount (~90%) of workers busy with "Writing to client" and "Closing connection".
I understand that this is normal. Considering that the clients are on a slower link, it will hold up Apache worker until the worker can deal away with an individual client request. But I was wondering if there is a dedicated system, h/w or s/w that can buffer the traffic on both request/and response. I've heard of all this "traffic acceleration" hardware, but I don't really know where to start looking for the one that will do just exactly that.
Thank you!
Try setting
Keepalive Off
in your Apache Vhost config.Sometimes Mobile connections are proxied by a server that will artificially hold connections open whilst they rewrite packets so that the mobile user gets ACK packets quicker than the server has actually ACKed them.
It's sneaky, but sometimes mobile networks are evil.
Since you mentioned hardware, you may want to look at something like F5's BigIP, which can make an enormous difference in situations like this. It'll terminate those mobile (and other) client connections, spool the content, and optimize the back end flows. It's expensive stuff though.
Another trick with mobile clients is that they often lose packets due to less than ideal signal strength as opposed to link congestion. This causes the TCP/IP stack to back off, so the data rates can be terrible. BigIP can help situations like this too, so it may be worth looking into.
On the open source front, you may consider fronting with nginx or another async I/O proxy to front your system and potentially buffer those connections a bit. This is probably a good first step to try - you can enable proxy buffering on nginx so the effect will be to offload the connections to nginx as opposed to apache and your dynamic apps behind it.