-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Haproxy crashes instance during scalability test due to high memory usage #8166
Comments
This just happened again:
|
This user seems to report the same issue: haproxy/haproxy#1984 , ant it seems to affect the same haproxy version that we are using |
Even with This has been reported multiple times. This seems very relevant to us: docker-library/haproxy#194 CPU usage spikes, memory seems constant. |
The more I look into it, the more this seems to be a memory leak. I'll updated the reproduction steps and issue description once I'm certain. |
It looks like memory usage plateaus at 17.56GB. This is tested locally, as the scalability test instance only has 15GB RAM and haproxy exceeding this value is probably causing the instance to become unresponsive. (Monitoring metrics pending). This issue appears very relevant: docker-library/haproxy#194 Quoting docker-library/haproxy#194 (comment):
|
I've traced the high memory usage to a config option that was added at some point in the archv3 work: Without these settings, memory usage plateaus at ~2GB. I'm testing it by running e2e tests against it and running the scalability suite against it. |
The solution to this was to:
|
Moved to "in progress" as we've decided to remove the "AT" statuses. @dianabarsan Please work with teammates until you're confident to merge this. |
@dianabarsan - I see @garethbowen approved the PR last week, but that there's a QA ("assistance"!! ; ) request in the prior comment. Lemme know if you need a hand with that ✋ |
hey @mrjones-plip |
Go ahead! |
Awesome! I'll work on this today and hopefully have something by the time you come back online tomorrow 🤞 |
tl;dr - I think the improvements are great! We're now much more resilient against HA going down and serving I had trouble reliably reproducing this with an unconstrained container on a 32GB bare-metal machine. HA proxy would float up to about 16GB of RAM use. When I constrained the container to 6GB RAM, it was no problem to reproduce. Here's the haproxy:
deploy:
resources:
limits:
memory: 6G In testing I always used the same command:
while having a concurrency of 600 across 800 connections to our monitoring API is totally unreasonable, we should never irrecoverably crash. Additionally I used Every single time I ran this command against my 4.1.0 instance it crashed in under 10 seconds. Every single time, all day every day: fail.good.720.mp4While hitting the API would result in an HTTP Using good.good.720.mp4Despite the errors, both the API and the web GUI (including |
Merged to |
Describe the bug
I started a scalability test, with 100 concurrent users, and haproxy crashed while the test was running. The behavior was that:
To Reproduce
Steps to reproduce the behavior:
master
Expected behavior
Haproxy should not crash
Logs
Beginning of haproxy log - to check that we're indeed on the latest config:
API Error:
Haproxy end of log:
Output of
docker ps
:Environment
Additional context
Manually restarting the haproxy container fixes the issue.
I don't have any insight into what the underlying issue is, I'll keep running tests to see how frequently this occurs.
In the worst case scenario, we should find a way to signal to the container to restart because the process was terminated.
It looks like this is being caused by Haproxy allocating resources for each opened connection, and those resources do not get freed, ending up bloating haproxy memory usage to 17GB, which is more than the test instance has allocated in total.
The text was updated successfully, but these errors were encountered: