Slow load-balancer on v0.43.1

Hi, I’m not sure if this is a bug or a mis-configuration on my part, but I’m seeing very slow response times when using a load-balancer with my services.

I have two host instances (AWS) and have tested with two different services (ghost and tutum/hello-world). Both the service and load-balancer are scheduled to run one instance on each host.

I’m consistently seeing a minimum of 5 seconds for responses to be received. If I attach the service directly to the public port (ie, without a load-balancer), the problem goes away.

I used the UI to set this up so here’s the generated docker-compose:

  - 80:80
  restart: always
  labels: 'true'
  tty: true
  image: rancher/load-balancer-service
  - test-app:test-app
  stdin_open: true
  restart: always
  labels: 'true'
  image: tutum/hello-world

And the rancher-compose:

  load_balancer_config: {}

Ok, so I can see the following line in the haproxy config - I’m guessing this is where my 5 seconds is coming from!

timeout connect 5000

I think this is a routing problem where the load-balancer on one host tries to contact a container on another?

Is there any way I can find out what’s causing this?

P.s. I’m also seeing this on version v0.42.0.

Figured it out!

The host instances are being launched in a VPC private subnet so needed the CATTLE_AGENT_IP manually setting to the private IP address.

For anyone else finding this problem, this page helped:

Thank you. Guys, for god’s sake, please move that information to “install” chapter of documentation! I’ve lost three hours figuring it out!

This is part of the installation section if you clicked on how to add custom hosts into Rancher. The install section of adding hosts talks about the different methods to add hosts, and the command above is specific to adding a custom host.

It’s just at the bottom of the page.