5

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

user178923
  • 51
  • 1
  • 3

1 Answers1

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/

WojonsTech
  • 350
  • 1
  • 10
  • 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. – Izzy 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 04: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 01:07