I use Haproxy 1.5.14 in VirtualBox VM (Boot2docker), where the resources it loads periodically show 503 without any real rhyme or reason, this is especially true when starting the cluster.
The cluster looks as follows: 1 interface with ports 80 and 443 by 2, serving static resources and web memory material, respectively.
Haproxy
- FE (front end for static resources)
- BE (back end, for network connections)
For example, a static asset serviced by the front end may be
https://local.dev.myproject.com/assets/images/back.png
Despite the fact that the front end server is up and nothing has changed, clicking update and looking at the chrome debugger, I will see many statuses 503 or OK 200 304, but this is not deterministic. It can go from 503 to OK to return to 503, for any asset. When connecting directly to the web server, the assets are returned in order, so there seems to be something with haproxy.
The best I can understand is that the health check is not working properly, and the FE / BE server is temporarily removed from the internal haproxy list, but it does not make sense checking every half second, and I see the haproxy calls being sent, returning to FE / BE ok terminal output window, every half second as expected.
If I look at the haproxy statistics report, I see that the servers periodically come and go, flicker, despite the fact that in the terminal window, haproxy still causes health checks without spaces, and the servers return them as expected.
The attached current haproxy configuration I am using, any help is appreciated.
#---------------------------------------------------------------------