-
Notifications
You must be signed in to change notification settings - Fork 367
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
Extremly high memory footprint of newer sslh version #291
Comments
2014, that was a long time ago :-) I don't see a valid reason for the memory usage to be that different. Once probing is done, sslh-fork is extremely simple: it's an infinite loop in |
Ok, after some investigation into how to... investigate... I find In particular:
The last two sslh-fork processes are actual connections, while the first two are listeners. So I would expect 5000 connections to use up 640MB... |
I will see if I can reproduce this on a test system, so far it only was a problem on our productive system. First quick scan shows, that the newer version indeed uses a lot more RAM than the old one does, but it does not explain the 9GB more used. Old:
New:
|
Are you sure it's really 9GB and not the shared RSS that totals 9GB but is in fact 1.6M many times over? The increase in shared memory isn't too surprising, the configuration system has become a lot more complex; it shouldn't matter much though. The unique memory is still three times over what it used to be, which I find a bit surprising. I guess the two measures are done with the same compiler, options, libraries and so so on? |
Well, the memory of the production system ran out, so yes, it used that much memory for real. I do not think it helps much to compare them. I will try to reproduce the memory consumption, but it will take a while. I cannot use the production system for that. |
Ok, another tool I'm finding useful is valgrind's massif:
Valgrind will write a And then
shows pretty graphs of the heap usage, where you can see what uses what. All my runs show pretty stable, minimal usage (expressed in tens of KB), so nothing to explain what you observe. I know valgrind can instrument stack usage as well, I'll look into that. |
We ran new tests with 1.22c and where not able to bring the server to crash. The problem might have been, that we ran the unstripped version of the binary that is more than twice the size of the stripped variant. Release to production will restart soon, if it manifests again, I will report. |
I was once again able to crash a server with this. Running the stripped version of sslh-fork 1.22c, the server gave up at aroung 6000 child processes. I really hope sslh-ev will drop soon and runs stable. It will be our saviour. |
I still don't see how sslh-fork would use so much RAM, and still don't see how to investigate... |
It would be nice not to have a |
like this? https://github.com/yrutschle/sslh/releases/tag/v2.0-rc1 :-) |
not to have ;) I would like to see a real release, but I can understand that it is not tested enough for releasing. In that case we need to talk internally if we can use it in RC state. |
oooooh I see. Apparently I only read the words I want, sorry :-) my argument "in favour" would be that the RC code will turn to "real release" anyway, so you may as well test it (I don't know if there are many people using "big setups" like yours testing release candidates...) |
Well I guess we switched back mid patch two times to the old binary, so we might just do it a third time :D |
Ok, I was now able to do a heap analyses and as I though, the newer version, 2.0RC in this case, uses a lot more RAM (x28 more) than the antike one. That is a very steep increase if you have a few thousand of these processes.
In this case we are talking about ~330 MiB instead of ~11 MiB of needed RAM per 1000 processes. |
@yrutschle Any news on this? |
Afraid not... I am still unsure how to even investigate this, and it's not currently at the top of my... heap... |
We used
sslh-fork head-2014-07-15
for a really long time and recently switched to a recent versionsslh-fork v1.21c-30-gb72baa0
and noticed a massive difference in memory usage between the two.With around 5000 incoming connections the old version uses around 2GB of memory, but the newer version uses around 11GB. We want to switch to
sslh-select
, but first need to check if the process hanging (#258) is resolved. But we would also like to know, if there is some general memory problem in newer versions ofsslh-fork
?The text was updated successfully, but these errors were encountered: