Load Balacing on my VPS, how it will work?

Hello,

I have setup a load balancer on a VPS server on a Round Robin scenario, however i noticed that the second server doesn’t get any traffic.

This is normal, as i have just one A record in DNS for my domain name, which points to Main Server IP. Any idea how i can make it send traffic on both Servers?

In general, you should be able to achieve this by adding another A record with the same “name” but with the IP pointing to your second server.

For more info on how it works: https://www.cloudflare.com/learning/dns/glossary/round-robin-dns/

I thought it might be easy as this,. but wasn’t sure if this would work!

And i guess in case one server goes down, the VPS LoadBalancer will undertake to steer the traffic and not, cloudflare, right?

Wait, if there a load balancer in front of your servers which has a specific IP than that is the only one you need to use as A record. The load will be split by the third-party load balancer.

If you have multiple servers that accept connection and you want to do some sort of load balancer (the actual product from Cloudflare has more functionality and more logging) then @Judge’s idea works. It won’t 100% of the time and it will delay the requests since it’s round-robin on each request with a fallback and won’t keep memory of what is working. Also, no clue if it requires a specific plan and doesn’t work on free.

This topic was automatically closed after 30 days. New replies are no longer allowed.