docker-flow / docker-flow-proxy

Docker Flow Proxy
https://docker-flow.github.io/docker-flow-proxy/
MIT License
317 stars 189 forks source link

Remove maxconn 5000 or add it to the docs #77

Closed gbhrdt closed 5 years ago

gbhrdt commented 5 years ago

Awesome library! We were struggling with load spikes in the past days and noticed timeouts. So we wanted to increase the maxconn setting. As the HAProxy statistics page only shows the global maxconn (we set it to 100000 via EXTRA_GLOBAL) we were wondering why only 5000 active connections were possible until we found this: https://github.com/docker-flow/docker-flow-proxy/blob/ed0ef0cfd52e9343dfbbfe9707fe0128e926aacc/haproxy.cfg#L13

It is documented nowhere that you need to set e.g. FRONTEND_EXTRA=maxconn 100000 change this. We assumed that setting the value in the global section would be enough but the default section seemed to override this.

thomasjpfan commented 5 years ago

This should be more clear in the documentation. I will add a note in the EXTRA_GLOBAL section. Does EXTRA_FRONTEND=maxconn 10000 solve your issue?

In general, haproxy needs both global and the frontend to be set. For example, if the global maxconn is set to 100000, and the default maxconn is not set. The frontend maxconn will still be set to 2000 (in haproxy 1.8.*).

gbhrdt commented 5 years ago

@thomasjpfan Thank you so much, that was fast! I can't say for sure that it's resolved, we did not have a load spike since I changed the setting. But I assume that was the problem, because when I saw the problem occur, HAProxy statistics page said "current conns = 5000".

I'll let you know when I am sure that this resolved my problem.

thomasjpfan commented 5 years ago

Since you have access to the admin panel, you can check global maxconn and frontend maxconn:

screen shot 2018-10-15 at 3 54 12 pm

The upper boxed number is the global maxconn, the bottom boxed number is the frontend maxconn.

gbhrdt commented 5 years ago

I think, it worked: