Comments on Apache: Creating A Session-Aware Loadbalancer Using mod_proxy_balancer (Debian Etch)

Apache: Creating A Session-Aware Loadbalancer Using mod_proxy_balancer (Debian Etch) Since Apache 2.1, a new module called mod_proxy_balancer is available which lets you turn a system that has Apache installed into a loadbalancer. This loadbalancer retrieves requested pages from two or more backend webservers and delivers them to the user's computer. Users get the impression that they deal with just one server (the loadbalancer) when in fact there are multiple systems behind the loadbalancer that process the users' requests. By using a loadbalancer, you can lower the load average on your webservers. One important feature of mod_proxy_balancer is that it can keep track of sessions which means that a single user always deals with the same backend webserver. Most websites are database-driven nowadays with user logins etc., and you'd get weird results if a user logs in on one backend webserver, and then his next request goes to another backend webserver, meaning he'd get logged out again. You can avoid this by using mod_proxy_balancer's session-awareness.

3 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Sean

Although you have a comment regarding the importance of the slashes when defining your balancer, I found that your setup still did not work, however making the corrections to the slashes mentioned in this blog entry fixed my problems and made everything work well.

 http://www.kaigrabfelder.de/en/2008/10/21/proxy_no_protocol_handler_was_valid_for_the_url.html

 I hope it will helps others.

Thanks,

Sean

By: Jakob Ericsson

This tutorial involves changing both backend and loadbalancer servers.

I did a solution where you only have to change the loadbalancer server. Loadbalancer is creating the balance cookie based on elected backend server based on environment properties set by mod_proxy_balancer.

http://www.jakeri.net/2009/03/sticky-load-balance-with-apache-httpd-22/

By: Mustafa

Could you kindly let me know if i could use server IPs in place of www1.exemple.com and www2.exemple.com??? I am currently confused with using www1 and www2... since i am not a programmer but only a network administrator and when i asked my php guy if we could use www1 and www2 in place of www, his answer was 'NO' :( moreover, my webservers are based on windows server 2008 and the load-balancer is zentyal server having inbuilt apache2 module on which i am already using mod_proxy module to redirect my requests to the webserver IP addresses. Also, i posted for help in the given link here, but response yet :( https://www.howtoforge.com/forums/showthread.php?t=53030 Regards