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

We are trying to find the most suitable load balancing solution that will work with our application, but I quickly found I don't know much on the subject. We were going to run Varnish Cache but we use client IP addresses at various levels and SSL - starting to get complicated... please help

Here's situation, we have one machine serving the below and looking spanning this across three. Probably share the one database.

Three types of traffic:

  1. Images for emails - Basic Apache traffic (minimal)
  2. Flash application - Large download(s) once per client
  3. SOAP Webservice - Up to a POST per client per second

The stack:

  1. Linux with PSAD
  2. Apache with Mod_Security
  3. Tomcat (Apache worker), JAX-WS app and MySQL database


  1. Maxmind GeoIP at app - needs client's IP address
  2. mod_security on Apache - also wants IP address
  3. SSL for both the Flash app and all SOAP calls

This is a preemptive measure for the client so we don't have load problems to solve as such, except if we test a DOS attack :)

Would Pound or Crossroads work? Is a software load balancer the right solution?

share|improve this question
Looks like request.getHeader("X-Forwarded-For") should fix my client IP address at the app level – KCD Jul 20 '11 at 1:43
I think I can also get mod_security working with mod_rpaf or mod_extract_forwarded2 ... still working on it! – KCD Jul 20 '11 at 2:08
up vote 0 down vote accepted

You want an L3 load-balancer -- something that forwards the TCP traffic to a backend server without doing anything in the middle. Anything that proxies or otherwise intercepts your TCP connections and forwards them on is not going to work (or will involve significant configuration and fragility). I use and recommend the Linux Virtual Server for all your load-balancing needs.

share|improve this answer
Thanks @womble, I think that is a good solution. Actually we have a DNS round-robin which is simple for now. We don't have sessions and are ok with minor unbalances and doing maintenance out of hours. In future will talk to our hosting provider about LVS. – KCD Jul 22 '11 at 3:44

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.