-
Notifications
You must be signed in to change notification settings - Fork 100
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
Excessive memory usage after upgrading to Sympa 6.2.62 #1170
Comments
Hi @drkspc , From what version you updated Sympa? |
Hi @ikedas , we upgraded from 6.2.60. |
That is really odd. How many lists/subscribers do you have? Do you use the list inclusions? Do you have merge feature enabled? Can you provide an excerpt of the task manager logs? |
We have
I attached an anonymized excerpt of the task_manager log from the first run I mentioned above. I did not spot anything different over the rest of the log (the full hour makes up almost 9000 lines). If you have something particular to search for, I'll try to find and post that. The errors about badly formed mail addresses are correct in the sense that there are actually garbage entries in one the inclusion sources. While these were already present before the upgrade, I will try to have them fixed. |
Hi @drkspc , Could you please apply this patch and check if the problem will be solved? Thanks. |
Hey @ikedas , thanks for the patch! I will be back at work on monday and do some testing then. |
@ikedas I applied your patch now and gave it a test run. Unfortunately, memory consumption doesn't look that much better yet:
Here is another excerpt from the from task_manager log. |
Maybe my patch wasn't related to the behavior you reported. Can you determine which list(s) are consuming the memory (Or, each list is consuming the memoey) ? |
Okay, I did some more testing now, still with your patch applied. What I did:
followed by
once for every list -- so like 3000 times. While these are running through, I can watch task_manager.pl blowing up in |
|
Here are our edit_list.conf and topics.conf (we only have a single list domain). From what I can see, memory consumption is not bound to any particular list(s) but rather results from the number of lists. As soon as I purge some lists (closed ones still have an impact), task_manager's memory footprint goes down. For this, I purged around 500 lists in three iterations and after each purge run and the next call to Loading Any thougts/ideas? |
N.B.: I suppose this issue is another instance of #584 . |
I understand the problem, but I couldn't reproduce such problem by my Sympa installation with more than 1000 lists.
My patch changed To be sure, could you please try undoing the customization of
|
IMHO we need to profile the task manager to get to the bottom of the problem. Suggestions:
Going to give it a try when I have some spare time. |
For reference, do you also get
for each of your lists? And how much memory does your task_manager need after running I moved both |
I just wanted to mention that we see similar behaviour with Sympa 6.2.62 on FreeBSD 12.2. In our case, sympa_msg.pl is consuming memory and memory use ramps up over a period of several hours or days before sympa_msg.pl eventually dies. It seems that the eventual (and currently inevitable) demise of sympa_msg.pl is related to the scheduler trying to swap it out. This is new behaviour that didn't exist in 6.2.60. However, unlike what's here, our installation is very small -- we only have about 50 lists, and very low traffic. |
Hi @ghalse,
|
FreeBSD pkg
I'm not sure how to tell that.
In the sympa logs see a regular repeatition of this pattern of tasks on an otherwise idle Sympa:
What's particularly interesting about the above is that the list in question was part of a set of lists created some time ago to test list inclusion, and only has a handful of subscribers. However, it always shows the the source as |
@ghalse , on your environment, |
@racke I did my last tests with all list inclusions removed and I did not notice a difference, so I fear this is not related... |
@ikedas @racke I now managed to tame the memory bumps down to around 15 to 20 MB (instead of 1GB+) by applying Memory still piles up over time, though -- just not as fast as before. |
@drkspc , if possible, can you attach context-style diff? |
@ikedas This seems to solve the issue on my idle system. By "idle" I mean that there is also nothing logged. As soon as I enable debug logging ( |
With my environment:
There are some (not more than 100 Megabytes) ups and downs in memory usage (i.e. VSZ & RSS), but it is generally stable.
Also, I tried running |
I don't see this memory problem either in my test VMs. Maybe it is a specific configuration option that causes the memory leak. |
@ikedas I think I can concur with @drkspc. Over the 18 hours or so I've been running that patch (with log_level back to default) I've not seen any significant growth in the process sizes. I'm now sitting at ~ 100MB as well. I do see some growth with a log_level set to >=2, but it's slower than before. |
@ghalse Thanks for information. Suspicious thing is that the problem seems only occurring in the environment of FreeBSD people: No problems have been reported by Linux people so far. |
I did some more tests with different log levels (with list includes). With no logging at all (I changed the levels in To me, this seems to be somewhat unrelated to the changes introduced by Sympa 6.2.62. Also, the problem of growing processes existed before (I'm fine as long as nothing else runs out of memory, so I mostly ignored it >.>). Here are some values on our production server with the new patch:
wwsympa is large, but will be replaced with a new process by apache after serving 300 requests. task_manager started at 260 MB, sympa_msg at around 200 MB. The log file for that time makes up only 8.9 MB, though, so I guess there is still some growth going on elsewhere, too. I am not entirely sure what to think about that, yet. |
@ikedas @racke I just spun up a fresh CentOS 7, installed Sympa, copied my list home/arc/spool/etc over from the test server and got Sympa up and running there. List inclusions are done, logging is normal, otherwise nothing happening (same as my test setup on FreeBSD). Memory usage didn't increase for about an hour now (I'll just leave it running until next week). I'd support @ikedas ' suspicion and say that there is either something odd with @ghalse 's and my setup or there is generally something wrong on FreeBSD. |
I can confirm the memory leak on FreeBSD (12.2). I use spawn-fcgi for starting wwsympa.fcgi (according to the documentation, but with TCP instead of unix domain sockets) and with every request on /sympa/, memory consumption grows about 2 MB. It grows even when I call /sympa/ unauthenticated. I used Devel::Gladiator for some debugging; copying differences between runs (like in synopsis of Devel::Gladiator) is not a good idea, because the copies itself increase memory usage; but counting numbers shows, that the leak doesn't seem to be in Perl:
Result (unauthenticated):
Maybe spawn-fcgi is the origin for the leak in wwsympa.fcgi, but top shows growing size for wwsympa.fcgi. |
When using Apache to spawn wwsympa.fcgi, the size of wwsympa.fcgi still grows per request about 2 MB. Hmmm. Maybe I made a mistake in the usage of Devel::Gladiator? |
Memory Consumption of task_manager.pl and sympa_msg.pl even grows, when there is no traffic. Two days later:
Since this error does not occur with CentOS, perhaps it is due to a newer CPAN library than typical Linux distros? |
Yes that is of course possible. |
Update on this: I upgraded my Sympa jail and this Perl Libs (new version on the right side):
In the CHANGES of the CPAN modules above, nothing sounds like a memory leak, and as expected there is no difference in memory usage. I removed the sleep 60 in task_manager.pl: with this, it is easy to reproduce the memory leak, memory consumption grows fast. And I used Level::NYTProf to look into hotspots. Archive with the result is attached. nytprof-sympa-taskmanager.zip |
I also tried the patch above via #1172. No change in memory consumption. task_manager without sleep needs about 23 Seconds to grow to 1 GB in my Test, with and without patch. |
So if it is any help, these are the FreeBSD Perl packages that updated at the same time as Sympa on our system: p5-CGI-4.52 There were some that updated two weeks earlier too, but I don't recall experiencing the problem at that stage. |
Thanks for information. What are the versions of following things, both before and after upgrading Sympa?
|
12.2-RELEASE-p6
perl5-5.32.1_1 (updated to that in early April, so prior to these problems). |
My Installation is a fresh installation, using config and lists from an old Sympa (running since at least 2013, latest installed version 6.2.52) on another server.
uname -a:
perl5-5.32.1_1 perl -v: Complete package list of my Sympa Jail (Sympa, Exim, Apache) and output of perl -V is here attached: |
Good news, but it does not help to find the reason: I updated my Server and the Sympa jail to FreeBSD 13.0. After reinstalling all packages (same version of all packages, but new FreeBSD-13-packages, compiled locally with poudriere), memory consumption is stable. When running a modified task manager with removed "sleep 60" (as mentioned above: #1170 (comment)) This is very strange. Running the jail with FreeBSD 12.2 binaries, the process site of the task manager was growing; maybe a little bit slower as before. |
I'm Just guessing... This bug in FreeBSD 12.2-RELEASE seems to be somehow related to our problem. It was reproduced with Perl not earlier than 5.26: Just an idea, if we set "lang en" in Sympa (in |
Oh! Sounds very reasonable; that would also explain why I haven't found anything with Devel::Gladiator. However, I wonder why this was not more noticeable. Possibly there are a lot of uselocale-libc-calls in the combination of Perl and Sympa that cause this. This could then possibly also be a performance issue? |
I don't know why. But I think this is worth trying:
|
I found that Sympa/Language.pm uses |
I tried different combinations of setting the If you have any other suggestions on what to try/test, I'll try do that. Otherwise my plan is to upgrade to FreeBSD 13 as well. |
Thanks for confirming! If setlocale on FreeBSD 12.2 (or so) is the cause of the memory leak, this issue is considered not problem of Sympa, then I think we may recommend upgrading FreeBSD and may close this issue. |
FYI This user also experiences growing memory usage with
|
That also supports that the problems weren't actually introduced in Sympa 6.2.62, but just became much more obvious. I wonder about the issues on SLES, though, but that might be something different. From my side, feel free to close this issue for now. There seems to be a way around with FreeBSD 13 and eventually 12.3 (if and whenever released). |
Okey, I'll close this issue for now. Thank you all for information! |
After upgrading to Sympa 6.2.62 we observed a drastic increase in memory usage by Sympa processes, in particular (but not limited to) task_manager.pl and sympa_msg.pl. On our production server memory usage increased by roughly 1GB per minute, resulting in things crashing after some time. On a test system (no postfix running, so no incoming mail traffic) I can observe this behaviour, too, obviously limited to task_manager.pl, though.
Version
Sympa 6.2.62, Perl 5.32.1, Jails on FreeBSD 12.2
Installation method
FreeBSD ports, packaged locally with poudriere
Expected behavior
Memory usage of Sympa processes stays reasoble, allowing the software to run over an extented period of time.
Actual behavior
Memory usage increases rapidly, crashing Sympa (and eventually other services) due to the server running out of memory.
Additional information
After some fiddling around I reverted commit 6371f6c and got back to a more usual behaviour. Memory usage still isn't great, but we can leave Sympa running again. I suspect the actual problem is not introduced by that commit itself, but just shows up much more clearly. Also, the named daemons would have grown very large after a long enough runtime (multiple weeks) with previous versions, too.
Sympa processes on our test system after running for about an hour (6371f6c applied):
Sympa processes on our test system after running for about an hour (6371f6c reverted):
The test system is set up identically to the production system and runs on copies of the production database and list home directory.
Please let me know if you need any other information.
The text was updated successfully, but these errors were encountered: