Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Open loadbalancer
New on LowEndTalk? Please Register and read our Community Rules.

Open loadbalancer

Hi, I am looking for a loadbalancer solution that does not restrict the connection of another host from itself.

Comments

  • What do you want?
    Just install HAProxy on a VPS and setup the configuration file.
    You can have multiple HAProxy boxes like that. If you don't want managed load balancer. You can add multiple A record at dns level so the browser can retry by itself.
    Otherwise, use a managed LB like Cloudflare load balancer

    Thanked by 1Vitaly
  • AXYZEAXYZE Member

    Haproxy or Nginx Reverse Proxy.
    Both super fast, efficient and easy to setup, plenty of guides online.

    Limited just by your server specs.

  • Another vote for haproxy on self-hosted end and Cloudflare Load Balancer on cloud side.

    Thanked by 1mohsengham
  • @eva2000 said:
    Another vote for haproxy on self-hosted end and Cloudflare Load Balancer on cloud side.

    Is it possible to use haproxy together with cloudflare cdn (without cloudflare LB)?

  • @AXYZE said:
    Haproxy or Nginx Reverse Proxy.
    Both super fast, efficient and easy to setup, plenty of guides online.

    Limited just by your server specs.

    I've used Nginx as a LB before but response time increases quite a bit when the LB redirects traffic to the other VMs. Did you have the same problem?

  • @quanhua92 said:
    What do you want?
    Just install HAProxy on a VPS and setup the configuration file.
    You can have multiple HAProxy boxes like that. If you don't want managed load balancer. You can add multiple A record at dns level so the browser can retry by itself.
    Otherwise, use a managed LB like Cloudflare load balancer

    Will adding multiple A record at DNS level work using Cloudlfare?

  • comXyzcomXyz Member

    For round-robin DNS, the browser just chooses one of the records randomly. The results are vary, be careful using it.

  • @gabydup said: Is it possible to use haproxy together with cloudflare cdn (without cloudflare LB)?

    Yes it's possible if you web application has a need for it and where Haproxy can do something that CF LB can't.

  • HybulaHybula Member, Host Rep

    Could you explain what type of load balancing you are looking for? Do you want to LB using a proxy (e.g. webserver)?

    We are running a free closed-beta for our DNS product which includes load balancing over DNS, this can be used in conjunction with health checking. This type of LB allows you to use servers from different providers. If you are interested, you may submit a ticket to enroll.

  • AXYZEAXYZE Member

    @gabydup said:

    @AXYZE said:
    Haproxy or Nginx Reverse Proxy.
    Both super fast, efficient and easy to setup, plenty of guides online.

    Limited just by your server specs.

    I've used Nginx as a LB before but response time increases quite a bit when the LB redirects traffic to the other VMs. Did you have the same problem?

    What is ping between LB and other VM?
    Is your traffic cacheable?
    What exactly you want to balance?

  • gabydupgabydup Member
    edited August 28

    @AXYZE said:

    @gabydup said:

    @AXYZE said:
    Haproxy or Nginx Reverse Proxy.
    Both super fast, efficient and easy to setup, plenty of guides online.

    Limited just by your server specs.

    I've used Nginx as a LB before but response time increases quite a bit when the LB redirects traffic to the other VMs. Did you have the same problem?

    What is ping between LB and other VM?
    Is your traffic cacheable?
    What exactly you want to balance?

    What is ping between LB and other VM? 75ms aprox. (in this case LB is in east coast, VM west coast).
    Is your traffic cacheable? No, it's dynamic content.
    What exactly you want to balance? Traffic between regions, example if CF pop is in Asia I'd like use the VM located in Asia as the origin server. (with CF free plan)

  • @eva2000 said:

    @gabydup said: Is it possible to use haproxy together with cloudflare cdn (without cloudflare LB)?

    Yes it's possible if you web application has a need for it and where Haproxy can do something that CF LB can't.

    Would that be the same as using CF's LB?

  • AXYZEAXYZE Member

    @gabydup said:

    @AXYZE said:

    @gabydup said:

    @AXYZE said:
    Haproxy or Nginx Reverse Proxy.
    Both super fast, efficient and easy to setup, plenty of guides online.

    Limited just by your server specs.

    I've used Nginx as a LB before but response time increases quite a bit when the LB redirects traffic to the other VMs. Did you have the same problem?

    What is ping between LB and other VM?
    Is your traffic cacheable?
    What exactly you want to balance?

    What is ping between LB and other VM? 75ms aprox. (in this case LB is in east coast, VM west coast).
    Is your traffic cacheable? No, it's dynamic content.
    What exactly you want to balance? Traffic between regions, example if CF pop is in Asia I'd like use the VM located in Asia as the origin server. (with CF free plan)

    You are looking at completly wrong solutions then.

    If you have load balancer in east coast then 100% of traffic needs to go there and then 100% of traffic goes to VPS (west side).
    Ofc that increases latency, because it is completly wrong and you should write from start what you are looking for exactly.

    You need geolocation/latency optimized routing - requests need to hit nearest target, not load balancer that you have in one location.

    https://www.cloudns.net/geodns/
    or
    Cloudflare Worker
    https://blog.cloudflare.com/update-response-headers-on-cloudflare-workers/

    But you can also do it via AWS Route53 or Cloudflare Load Balancing (+ additional geo traffic steering addon), this should be easiest to setup and it does everything for you (health checks, sticky sessions etc.) but is more on expensive side.

    You can do it yourself.
    To do it you need to use provider which has "Anycast IP" like BuyVM
    https://buyvm.net/anycast-vps/
    Then requests to one IP will be routed to nearest server - this is what you need!

  • Thank you @AXYZE !
    Between the 3 options you mentioned (CF, cloudns geodns, anycast IP) which one you think would be the best in terms of performance?

  • @gabydup said:
    Thank you @AXYZE !
    Between the 3 options you mentioned (CF, cloudns geodns, anycast IP) which one you think would be the best in terms of performance?

    BuyVM Anycast IP only supports 3 regions (LA, NJ, LUX). And you need to have VPS on all regions to enable that features. If you want to use VPS from other providers then it is not as easy.

    GeoDNS performs geo routing at the DNS level. You can use cloudns, aws route53 or google cloud dns. ClouDNS is a subscription type service ($9.95 per month). Route53 & Google DNS is pay as you go service. If your website doesn't have much traffic then pay as you go is cheaper in my opinion. With this option, your users connect directly to the IP of the nearest server. So, if you have more traffic in US, you may want to have a HAProxy on the US server to load balance traffic to more US servers. Also, you have to rely on the DDOS mitigation of your VPS providers. Some low end providers do not have good DDOS mitigation and will null your server. Also, you will also need DNS failover to have health checks.

    Cloudflare load balancer is the easiest solution. The traffic goes to CF first. Then, CF will route it to a healthy + nearest server. The cost starts at $5. DNS queries are not unlimited. So, it is $5 + pay as you go. However, CF adds overhead to the request so you may not want to proxy the traffic to CF.

    Thanked by 1gabydup
  • AXYZEAXYZE Member

    @quanhua92 said:

    @gabydup said:
    Thank you @AXYZE !
    Between the 3 options you mentioned (CF, cloudns geodns, anycast IP) which one you think would be the best in terms of performance?

    BuyVM Anycast IP only supports 3 regions (LA, NJ, LUX). And you need to have VPS on all regions to enable that features. If you want to use VPS from other providers then it is not as easy.

    GeoDNS performs geo routing at the DNS level. You can use cloudns, aws route53 or google cloud dns. ClouDNS is a subscription type service ($9.95 per month). Route53 & Google DNS is pay as you go service. If your website doesn't have much traffic then pay as you go is cheaper in my opinion. With this option, your users connect directly to the IP of the nearest server. So, if you have more traffic in US, you may want to have a HAProxy on the US server to load balance traffic to more US servers. Also, you have to rely on the DDOS mitigation of your VPS providers. Some low end providers do not have good DDOS mitigation and will null your server. Also, you will also need DNS failover to have health checks.

    Cloudflare load balancer is the easiest solution. The traffic goes to CF first. Then, CF will route it to a healthy + nearest server. The cost starts at $5. DNS queries are not unlimited. So, it is $5 + pay as you go. However, CF adds overhead to the request so you may not want to proxy the traffic to CF.

    CF Load Balancer starts at $15, because you need $10 addon for traffic steering. It is needed for latency or geo based routing... hidden cost...

    Thanked by 1gabydup
  • AXYZEAXYZE Member

    @gabydup said:
    Thank you @AXYZE !
    Between the 3 options you mentioned (CF, cloudns geodns, anycast IP) which one you think would be the best in terms of performance?

    All are equally fast and equally slow - all depends on routing, vistors location, cost.

    Cloudflare is easiest to setup, GeoDNS/Anycast IP has bigger potential in the same proce if you can tweak it and you have VPS with good networking routing - so it can have better performance than CF but you need a lot more work to do.

    Maybe @yoursunny can show you more options to do it on budget :)

    Thanked by 1gabydup
  • yoursunnyyoursunny Member, IPv6 Advocate

    I used to have yoursunny.com in Phoenix and yoursunny.cn in Singapore (OneAsiaHost with optimized China route), serving the same website.
    Readers from China (judged by IP geolocation) are redirected to the .cn site.

    Thanked by 1gabydup
  • Thank you @quanhua92

    ClouDNS offers DNS failover, right?

    CF with LB plus addon for traffic steering seems quite expensive if you have several sites.
    What about a solution using Cloudflare without LB and an Anycast IP provider?
    At least this way traffic from the CF POPs to the origin servers would be optimized thanks to the Anycast IP?

    Btw does any other big provider like DO, Vultr, Hetzner, etc. offer Anycast IP? I haven't found anything on their sites.

  • quanhua92quanhua92 Member
    edited September 1

    @gabydup said:
    Thank you @quanhua92
    CF with LB plus addon for traffic steering seems quite expensive if you have several sites.

    No. Actually opposite. They allow multiple website to share the same pool. So, if you have 10 website and all shares the same servers then the cost is much cheaper than GeoDNS.

    What about a solution using Cloudflare without LB and an Anycast IP provider?
    At least this way traffic from the CF POPs to the origin servers would be optimized thanks to the Anycast IP?

    It is possible to use CF free + anycast IP. But not many providers support this feature. You can use BuyVM to run HAProxy and the route the traffic to other providers. BuyVM anycast is not ideal for Asia anyway. If you only have US and EU users then it is great

    I use a simple trick to use Cloudflare free + google dns on another unrelated domain. Basically, the dns record of the main domain is CNAME to the geo dns on Google DNS. So, I can take advantage of CF free pops and georouting on google dns (can be cached & cheap). But the downside is no health checks. If the server down then I need to use a cronjob to update the dns record on CF. My next step is to use CF LB in near future.

    Btw does any other big provider like DO, Vultr, Hetzner, etc. offer Anycast IP? I haven't found anything on their sites.

    DO, Vultr only supports LB in the same region. You need to use other services (geodns, gg dns) to do georouting

    Thanked by 1gabydup
  • @quanhua92 said: I use a simple trick to use Cloudflare free + google dns on another unrelated domain. Basically, the dns record of the main domain is CNAME to the geo dns on Google DNS. So, I can take advantage of CF free pops and georouting on google dns (can be cached & cheap). But the downside is no health checks. If the server down then I need to use a cronjob to update the dns record on CF. My next step is to use CF LB in near future.

    So you need an extra domain to achieve that? You're still using CF's DNS, right?

  • @gabydup said:
    So you need an extra domain to achieve that? You're still using CF's DNS, right?

    An extra domain is managed at Google DNS to achieve the geo routing. The main domain is at CF DNS (free orange cloud).

    Thanked by 1gabydup
  • mati03250mati03250 Member
    edited September 2

    @quanhua92 said: geo dns on Google DNS

    Such an option is provided within Google Domains and by specifying more addresses in the record it comes to selecting the one closest to it?

  • dragon1993dragon1993 Member
    edited September 2

    Anybody try that? (Load balancer with Cloudflare Worker)
    https://github.com/xiaoyang-sde/reflare

  • @dragon1993 said:
    Anybody try that? (Load balancer with Cloudflare Worker)
    https://github.com/xiaoyang-sde/reflare

    Interesting. Do you need to pay for Cloudflare's Load balancers for this to work?

  • @gabydup said: Interesting. Do you need to pay for Cloudflare's Load balancers for this to work?

    No, it is not unnecessary for Worker to work, he himself as a SaaS service runs instances on the edge of Cloudflare infrastructure with your code.
    https://www.cloudflare.com/learning/serverless/serverless-javascript/

    On the other hand, reflare does not yet have checked http/https server status detection, only selects servers randomly or according to the specified weight, and it lacks consideration of the task location and assignment to the nearest one.
    But it seems like a good solution as a simple gateway, once upgraded.

Sign In or Register to comment.