Best practices - Load Balancer Website on Rancher?

Hi guys,
we need to host a website on rancher and are trying to figure out how to do it the best way.

We have 3 hosts with public IP .

Here what we did :

  • We defined a round robin in our dns server (external) to www.domain.com to the 3 public IPs
  • We created a container with the web service that we scaled to the 3 hosts
  • We configured a container with the rancher load balancer service to point every https 443 request to Webservice container port 80
  • We scaled the rancher load balancer container to our 3 hosts and defined the certificate

Is it the best way to fulfill our needs ?

It currently works but sometimes response times are slow and I suspect the load balancer to be the culprit.

Many thanks

Sounds correct from my understanding. Have you measured response times without the load balancer in place? Within your local network and from the WAN side?

1 Like

we just solved the problem.

one of the 3 servers was not responding on its public IP.
For rancher it was up as its private IP was responding.

Timeout was due to the DNS not resolving and round robin time to pass to another server.

Is it possible to automatically disable a server not responding, either by DNS mechanism (which was our issue) or rancher ?

Many thanks

Sounds like you’re looking for a custom haproxy.cfg to be merged with the default configuration generated by Rancher. There’s a section in the load balancer page for this in the load balancer edit page of the Rancher ui.

Although I have yet to try this myself, this is the approach I would start with.

Check out the example here:

1 Like

Many thanks !
I get your point, but on my opinion, if a server is not responding to dns requests, no matter what you put behind you will always suffer the timeout before it passes to next server in round robin right ?

It shouldn’t matter with HAproxy. Give it a shot. Set up a http-check then take a node out of the pool.

1 Like

Found some more resources for you:

https://docs.traefik.io/basics

1 Like