connectiontimeout time

Apache have released their latest httpd server version 2.2.10. While I am happy to have all the bug fixes that this provides, the biggest bonus for me is the addition of the connectiontimeout directive to the mod_proxy module. This directive allows me to distinguish between the length of time it takes to connect to the proxy server and the length of time it takes to return a response. This is a big deal for my setup as I have a lot of legacy applications behind my proxy that take a long time to return (in the order of minutes). This means that I have never been able to set the timeout on the proxy to less than 2 minutes. Having a high timeout has had a negative impact on the user experience when one of the machines behind the proxy breaks down. If the user is unlucky and the proxy tries to connect to that dead server, then they will have to wait for 2 minutes before the server fails over and they get a response. The connectiontimeout directive allows me to set a really low timeout in the order of 2-3 seconds, greatly reducing the time required for the proxy to decide that the backend machine is not available. Now the user will get a response from a machine that is working within 2-3 seconds instead of 2 minutes. I think you'll agree that is a vast improvement.

Now for the bad news. It would appear that you have to set the connectiontimeout directive for each member of a balancer group as opposed to setting it for the group. So my balancer group that looks like this:

	<Proxy balancer://liveresin >
	  BalancerMember  http://192.168.1.1:8000  route=1
	  BalancerMember  http://192.168.1.2:8000  route=2
	  BalancerMember  http://192.168.1.3:8000  route=3
	  BalancerMember  http://192.168.1.4:8000  route=4
	  BalancerMember  http://192.168.1.5:8000  route=5
	  ProxySet  lbmethod=byrequests stickysession=JSESSIONID
	</Proxy>
	

now looks like this:

	 <Proxy balancer://liveresin >
	  BalancerMember  http://192.168.1.1:8000  route=1  connectiontimeout=3
	  BalancerMember  http://192.168.1.2:8000  route=2  connectiontimeout=3
	  BalancerMember  http://192.168.1.3:8000  route=3  connectiontimeout=3
	  BalancerMember  http://192.168.1.4:8000  route=4  connectiontimeout=3
	  BalancerMember  http://192.168.1.5:8000  route=5  connectiontimeout=3
	  ProxySet  lbmethod=byrequests stickysession=JSESSIONID
	</Proxy>
	

I am unhappy with this as I have to set the same directive 5 times. Would it not be better to set it once in the ProxySet directive and then if needed override it for individual nodes. Maybe this is something that can be added in future releases. Anyway, thanks to the apache team for making my servers that much more responsive.

This entry was posted on Thu, 30 Oct 2008 13:20:50 GMT . You can follow any any response to this entry through the Atom feed. You can leave a comment .
Tags , , , ,


Comments

Leave a response

Leave a comment


weewar.com corner