Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently trying to figure out the best way to load balance multiple sock 5 proxy servers for my new project. I was looking into programs like HA proxy, but it seems to only load balance HTTP Proxy's and for this project i need Sock5's. I looked into DNS round robin, but i haven't found a way for it to instantly fail over to one of the other servers or remove them from the rotation. I also found that the TTL doesn't update fast enough for the seamless switch to another server when one goes offline. This has really been troubling me for a while and i find it really hard to explain my case as i have little experience with load-balancing and preventing failures for users as my projects have only recently been gaining traction. If What i just posted seems to make no sence i made a diagram below on what i am trying to configure.

So basically what i am looking for is a solution to effectivly loadbalance a sock5 proxy while removing servers that go offline. http://puu.sh/3mLvL/6ef73d46d4.png

share|improve this question
    
You simply wanna be able to load balance tcp connection within the same datacenter? –  WojonsTech Jun 24 '13 at 1:34
    
Hello, That is exactly what i want to do. –  user178923 Jun 28 '13 at 16:47
1  
HAProxy can also load balance tcp connections, so this might be still an option, haven't tried the tcp mode myself though. –  MKzero Jun 28 '13 at 23:05

1 Answer 1

There are a few ways to go about this. Many providers will allow you to rent or buy a load balancing device like a F5 or something like that. These devices can load balance tcp connections and many level 7 connections to a set of machines. Now if you are unable to get a load balanacer on hardware there are other choices out there like nginx, haproxy, and apache all have load balancing tools to do this.

I recommend that you go with a hardware one if you can you have a project that needs something to be super fast. Dont get me wrong I use a lot of nginx proxying. Some times I have tcp proxy to ha proxy for level 7. Since the hardware load balancers wont need to use as much power and you can use a lot more nginx loads to handle the rest of the traffic, this is useful when you need to do a lot of SSL termantions, to get hardware load balancers to do a lot of ssl cost a lot but apache,haproxy,nginx can do it for fairly cheap.

Nginx: http://wiki.nginx.org/HttpProxyModule https://github.com/yaoweibin/nginx_tcp_proxy_module

Apache: https://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

HaProxy: http://tenfourty.com/2011/04/09/how-to-load-balance-tcp-connections-with-haproxy/

share|improve this answer
    
Newer versions of HAProxy(and probably other software) can use kernel TCP splicing, which greatly reduces overhead and might even get close to hardware balancing. Pro for software: You can take two cheap VPS and make them HA. Most likely much cheaper than an F5 or something similar. –  MKzero Jun 28 '13 at 23:40
    
I just looked into the tcp splicing and that is really cool yeah if this is now a stable option it really maks no reason to have some fancy load balancer your paying for. –  WojonsTech Jun 29 '13 at 4:34
    
Thanks loads for the reply. I was unsure if HAproxy was able to balance Sock5 proxys, i knew it could balance http proxy connections i just was told that it didn't support sock5 so you have to use something like DeleGate proxy server to convert it to http. I'll take a peak at the article and hopefully have something functional at the end of today. –  user178923 Jun 29 '13 at 17:50
    
I want to say thank you to all the great posts. In the end HAproxy worked wonders for me! –  user178923 Jul 10 '13 at 1:07

Your Answer

 
discard

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.