Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have 3 webservers behind a reverse proxy/loadbalancer. Currently I use Apache 2 but don't mind switching.

Those webservers are not equal. They have different sets of local data meaning that different kinds of requests will be handled more efficiently on specific webserver.

I want to plug some custom routing logic into my loadbalancer, that would on start of a new session select a webserver for it, then tie that session to that node until it breaks down (sticky session).

For example: a new user comes to the webapp, load balancer runs my custom code somehow, this code finds out information about that user and makes a conclusion that this user should be handled on node1. The balancer proxies that user to node1 and sticks it to it. When another user comes, custom routing logic suggests node3, to which loadbalancer then proxies this user.

Is it possible to do with Apache 2? If not, what proxy/loadbalancer would give me that ability?

Thank you.

share|improve this question
I guess a lot hinges on the details behind "my custom code" and "finds out information about that user". What code are you trying to run? And, what information are you looking to gather on which to make your balancing choice(s)? – TCampbell Oct 13 '10 at 13:22
up vote 2 down vote accepted

you can consider haproxy as an option. you can use it to implement sticky sessions and do custom http L7 routing (header, url based)

share|improve this answer
+1 haproxy does this really easily. – Antoine Benkemoun Oct 13 '10 at 14:25

If haproxy is to complex for you, try pound.

share|improve this answer
i second pound, used it in production with keepalive, worked great. – luckytaxi Oct 13 '10 at 13:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.