Webmin collection and others high memory consumption

SYSTEM INFORMATION
OS type and version Debian Linux 12
Virtualmin version 7.30.4

This the running process on my Linux server 10mn after a restart.

On and on, webmin is using a lot of memory with no mail and only one website.
I have 2 other Virtualmin installed and there the running process are completely different.

Any ideas on how to reduce memory consumption ?

Not sure, try adjusting the interval to a larger amount and see if it settles down.

Something pathological is happening, but I can’t guess what. Those collectinfo.pl processes are huge, they should only run for a few seconds, and it shouldn’t run if another one is already running. Are you out of disk space on any of your partitions?

collectinfo.pl does start apt-get, though, and apt-get can grow pretty large in some circumstances. So, check to be sure apt-get update is behaving, and maybe make sure nothing is weird about the state of your packages (e.g. dpkg --configure -a and check for errors/issues). I can’t think of anything else collectinfo.pl would be doing that’d take a long time or consume a lot of memory.

Oh, and, try this:

Grab the PID of one of those collectinfo.pl processes, any one will do as long as it’s running.

Then do:

strace -p <pid-of-process>

And, see what it’s doing. Maybe show us a couple dozen lines of whatever it’s doing, if it’s not obvious to you what it’s doing. That shows syscalls as they happen, so it may or may not show us something interesting about what kind of work collectinfo is trying to do. It may be “hung” waiting for something (e.g. if apt-get update is really slow or some other query it’s trying to do is timing out).

Thank you Joe for looking at this.

Some feedback;

  1. I restarted the Server (a virtual container) 24h ago and I have only one collection.pl running (207422 root 2.12 GiB /usr/share/webmin/virtual-server/collectinfo.pl). (to be confirmed with monitoring in time). It is the same PID for 3 to 5mn start around 76Mb and ends around 2.9Gb. Then after a minute or two a new one start and so on.

  2. This instance has a lot of free disk space (110.33 GiB used / 133.26 GiB free / 243.59 GiB total)

  3. apt-get update, apt-get upgrade and dpkg --configure -a behave normally (0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded and no errors)

  4. I ran strace -p <pid-of-process> and I have A tons of
    newfstatat(AT_FDCWD, "/home/domain/tmp/sess_otn0ga3qgsblrs54ktu2n2l36h", {st_mode=S_IFREG|0600, st_size=349, ...}, 0) = 0.
    For more rows: pastebin.
    At some point, I guess after reaching 2.92Gb the last row:
    newfstatat(AT_FDCWD, "/home/aimfair/tmp/sess_8s5rqqvarm9066bej0uhe7n7e8", {st_mode=S_IFREG|0600, st_size=651, ...}, 0) = 0 +++ killed by SIGKILL +++

Edit; I have now 4 collectinfo.pl running:
|226486|root|1.55 GiB|/usr/share/webmin/virtual-server/collectinfo.pl| |227651|root|1.52 GiB|/usr/share/webmin/virtual-server/collectinfo.pl| |228802|root|1.49 GiB|/usr/share/webmin/virtual-server/collectinfo.pl| |229817|root|1.48 GiB|/usr/share/webmin/virtual-server/collectinfo.pl|

Hope that help pointing the issue.
Bernard

Thank you Stefan for pointing to this configuration panel. :pray:

So, those are session files, presumably for a web app you have running on your system, maybe something PHP, maybe something else. Having a gazillion of them is probably indicative of something going wrong. Normally web apps clean up after themselves, and most folks running a single shared hosting system don’t run apps that have hundreds of thousands of daily logged in users for their apps.

Why Virtualmin is reading them is a mystery to me, though. I’ll have to look at the code.

Are you using soft disk quotas, by any chance? I think in that case, we’d check usage simply by looking at the files and adding the sizes up, and a gazillion files would take a while to think about.

I just check, I usually have quota set to unlimited on my different server, but on this one I don’t see this section when I Edit the Virtual Server.

On the Edit Server Template, Default Settings the Disk quotas type is set to Hard (enforced)
Something to change for better management ?


I understand something is creating gazillion of “sess_”.

I will need a way to track this, but for now I can’t even see the directory content.
I went to the tmp folder and ran “ls -l” 5mn ago and still no output. :scream:

I believe I should first empty this directory to be able to get back to a “semi-normal” state.
Then check what is creating so much files.
But I fear a simple
rm sess_* won’t work.

A failsafe system will be good, but first I need to find what is producing so many files and why they aren’t flushed.

Thanks.