5

Will performance and/or stability suffer if I run HAProxy (or Nginx) in a container vs installing it directly on the host?

iZ.
  • 201
  • 3
  • 5

2 Answers2

7

There is a good SO answer at https://stackoverflow.com/a/26149994/684908 on the subject of performance. The tl;dr is that the NAT (port-forwarding in some cases) introduces some latency. Though, it is likely negligible at smaller scales.

I run HAProxy as a container in production with port-forwarding through the Docker NAT bridge. The application and HAProxy was originally running on bare-metal. Any latency or overhead that might have been introduced by Docker is too negligible to tell.

Andy Shinn
  • 4,211
  • 8
  • 40
  • 55
3

The chief concern should be that you will have to wait for the container to be updated before getting any security, feature, or bugfix patches. You can't just run yum/apt-get/yast upgrade on the host, you need to either rebuild the container yourself, or wait for someone else to.

Hyppy
  • 15,608
  • 1
  • 38
  • 59
  • i agree.. making config changes would be a giant headache.. what I've done is run haproxy on the host and it proxies connections into docker containers. – Mike Mar 31 '15 at 19:08
  • Thanks. Would you expect a difference in performance though? – iZ. Mar 31 '15 at 20:02
  • 1
    No noticable difference, aside from maybe a tiny bit of extra memory space for the Dockerized libraries. – Hyppy Apr 01 '15 at 14:15