-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix memory leak for 0mq transport in case of TCP DDOS #36618
Conversation
In case anyone is trying to "DDOS" zeromq transport with TCP messages, we've got ZeroMQPubServerChannel process utilized more than 8GB of RAM. With this patch, we have got ZeroMQPubServerChannel stabilized at 300MB for > 500 nodes. It doesn't affect performance for 0mq minions, as it perform gc.collect only in case of exception.
@cachedout can you please take a look? I'd desperately like this to be in 2016.3.4 if at all possible. |
@cachedout
Which means, the time you disable garbage collecting and re-enable it later, it lost counts of objects, and start over again.
As you can see, disregard that my threshold is set to Generally speaking, disabling gc in python just to process one message is quite overkill, but I trust that you made some tests and it is working better with |
@onorua Thanks for the explanation. If I recall correctly, this was enabled at the advice of the msgpack project. They have a note on it here: https://github.com/msgpack/msgpack-python#gc Some testing on this was done on the Salt side but it was a long time ago and I don't have the results handy right now. |
@cachedout how big is the message? From the msgpack statement I understood that it is the case only for large messages. I believe we could try to comment out |
@onorua I am fine with putting this |
What does this PR do?
In case anyone is trying to "DDOS" zeromq transport with TCP messages,
we've got ZeroMQPubServerChannel process utilized more than 8GB of RAM.
With this patch, we have got ZeroMQPubServerChannel stabilized at 300MB
for > 500 nodes, with no performance penalties. It doesn't affect performance of 0mq minions, as it perform gc.collect only in case of exception.
What issues does this PR fix or reference?
#36612
Tests written?
No