I need some info. I have been looking for this solution all over the google, but could not find it. I am trying to setup HAProxy to balance the downloaders in one server not send them to other servers like the configurations are around the internet. I need to setup haproxy so it binds connections that come to localhost port 80 to ports like 8081,8082,8083 in localhost.

The question I am asking is that do I need to setup multiple nginx configurations to those ports? Can I use Thin application to setup the Thin servers? I am having a huge trouble understanding how to do it. Can anyone point me in the right direction?

  • I'm not quite sure I understand what you mean. You want to set a up a loadbalancer on a server to balance traffic on the same server to more applications running on the same machine? Sounds strange to me. – Christopher Perrin Jul 28 '13 at 13:40

Well, you can do normal round robin ( connection 1 to backend A, 2 to B, 3 to C, and again, connection 4 to backend A, 5 to B, ...), weighted round robin load balancing (round robin with conditions), weighted hash load balancing (each connection has a unique hash and the connections take in account the hash to not lose the connection), ...

You can find more informations here : http://haproxy.1wt.eu/download/1.4/doc/configuration.txt

However, there is a lot of disadvantages to do load balancing on the same server on the same system : if the system fail, everything fail, with round robin, you lose the continuity of your connection (if one guy come to your website, visit, close his browser, then come again, it's not sure it's the same backend which will serve him again), ...
You should at least have different VMs on the same server and try to have the same load on each of your VM.

The only good reason to do what you're trying to do is indeed to have failover, not loadbalancing, between processes, so if one crash, an other can perform the same task. However, to do that, you need a failover monitored round robin (you perform round robin and you monitor the state of each of your backend and as soon as one crash you remove it from the round robin list), and as it's round robin, you lose the continuity of your connection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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