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:

app-lb:
  ports:
  - 80:80
  restart: always
  labels:
    io.rancher.scheduler.global: 'true'
  tty: true
  image: rancher/load-balancer-service
  links:
  - test-app:test-app
  stdin_open: true
test-app:
  restart: always
  labels:
    io.rancher.scheduler.global: 'true'
  image: tutum/hello-world

And the rancher-compose:

app-lb:
  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:
http://docs.rancher.com/rancher/rancher-ui/infrastructure/hosts/custom/#vms-with-private-and-public-ip-addresses

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.

http://docs.rancher.com/rancher/rancher-ui/infrastructure/hosts/custom/