Monday, September 19, 2011

KeepAlive or not?

People have been discussing about turning an Apache feature on/off while I have been scratching my head wondering why the clients at the far side are suffering slow HTTPS connection behind NAT router and firewall.

HTTP v 1.1 protocol provide nice feature KeepAlive for Apache server to keep active connection opening to serve ongoing requests from the same client. In case of a prefork MPM Apache instance, it means a lock on the work process to this particular client and will no longer release until the client is completely fulfilled and let go.

For dynamic web application written by PERL, PHP or any other scripting language, a prefork process might be occupied by these resources intensive requests which cause a heavy loading at the server side. KeepAlive would create prolonged period of time for the process to work for one client only while others are waiting for the service. The process may actually work for many other clients at the same period of time. To free this, a temporary solution would be turning KeepAlive feature off in the configuration file like "httpd-default.conf".

A blogger Steve has found a programming way to sort this out but it may not good enough for ultimate setting embedded in Apache server itself. Anyway, it is still a workable solution.

For a better understanding, please read this.



1 comment: