0

We're in the process of migrating a microservices application to dcos. The current version of the application use nginx as a reverse proxy. In moving to dcos, we'd like to replace nginx with marathon-lb. This is working well, with one exception. Nginx returns the expected Connection:keep-alive http header, but marathon-lb does not.

We have not changed the default configuration of marathon-lb in any way, and as far as I can tell haproxy has the expected defaults. Specifically, the http-server-close option. Here is a snippet from the config.

defaults
  load-server-state-from-file global
  log               global
  retries                   3
  backlog               10000
  maxconn               10000
  timeout connect          3s
  timeout client          30s
  timeout server          30s
  timeout tunnel        3600s
  timeout http-keep-alive  1s
  timeout http-request    15s
  timeout queue           30s
  timeout tarpit          60s
  option            dontlognull
  option            http-server-close
  option            redispatch

My services have labels with the following format:

  "labels": {
    "HAPROXY_0_PATH": "-i /alerts",
    "HAPROXY_0_HTTP_BACKEND_PROXYPASS_PATH": "/alerts",
    "HAPROXY_0_VHOST": "foo.bar.com",
    "HAPROXY_GROUP": "external"
  }

What am I doing wrong?

herbrandson
  • 2,357
  • 2
  • 30
  • 44

1 Answers1

0

Try use option http-keep-alive and option prefer-last-server.

See : Haproxy + netty: Way to prevent exceptions on connection reset?

You can override default configuration by HAPROXY_GLOBAL_DEFAULT_OPTIONS.

See : https://github.com/mesosphere/marathon-lb#haproxy-global-default-options

MinGyoo Jung
  • 269
  • 2
  • 6