Rhis is a memory leak?

SYSTEM INFORMATION
OS type and version ubuntu 22.04
Webmin version 2021
Virtualmin version 7.7
Related packages SUGGESTED
hi to everybody
i have a 40 days new server with a stock ubuntu 22.04, & i am so impress
but i watch a weird behavior

this is after boot up!

this is after 1 day

8 days!

10 days!

why?. i have a i5-7400 system with 8g DDR4
why virtual mem is increasing?
in the past, i always made update and diferent process with a restart inclued. but this time i suspend updates and suspend because i like to know how this process ends

How many Virtual Server are you running? Also are you running virus scanner.

you need to check what processes are running and what’s using all the real memory(ram) causing the system to swap (virtual memory).

1 Like

22 virtual server, how a temporary process like AV can increase mem and virtual mem permantently?

how can i check it?

Click on the Ram usage should list usage

click restart PHP-FPM server, does this reduce ram alot?

AV should not be a temporary process. ClamAV is far too large, and takes far too long to start up to be run intermittently. You must use the daemon version of the scanner (which starts one server that runs forever). No one has enough computing resources to run ClamAV on-demand, if you get more than one or two messages an hour (and even then, it’s wasteful to run the non-daemon version).

i have too many “daemons” ( is this the name?)


is this may be the source?

yes, you are right, size on mem of AV is arround of 1Gig
anyway , my problem is not ram , because ram can oscillate but never reach max ( i never see it), but virtual mem, any day is increase never decrease

You certainly have a lot of PHP versions there. That is almost never a good idea. Why did you install so many? Most people only need one version (most apps work in all the current versions), and almost nobody needs more than one of each major version (you have four 7.x versions and two 8.x versions, that’s crazy!).

But, that’s still just guessing. You need to look at what’s actually using memory on your system. You can look at the process list in Webmin, or you can look at top (I prefer top) or htop on the command line and sort by memory.

You can’t guess your way out of problems like this. You need to gather useful data, and then make an assessment of what needs to change.

Also, PHP 5 has been unmaintained for years. It’s reckless to run it on a distro that doesn’t have a maintained package of it (that’s only CentOS/RHEL 7 at this point). If you must have it for some old software that you can’t update for some reason, I’d recommend you isolate that one app on its own server with no other users or data (and run CentOS or RHEL 7 so you have a maintained PHP5 package).

1 Like

yes, you right certainly i hacve too many, the reason wos the next: when we begin this work, we import a lot of very old wordpress site . now we fix and update all of the, but i really dont know how to remove w/o problems. i think is enought with 7.4, 8.1 and 8.2,. could you recomend me a command/script for uninstall them safely?
about running process mem list , ther are a huge amont of " php-fpm: pool xxxxxxxxxxxxxxxxxxxxx" process ( may be 50 or 70) witha amedia size of 80/150 mb each

hi, i use apt-get remove with sucess ( i hope)
and after this i use re-check and i restart apache and the 3 fpm deamons
now i have 50% of the previous values of ram and virtual mem
off course , i need to wait 7 o 10 day for compare

1 Like

Hello there,

When memory usage is high, try to restart only apache2 - if the memory usage drops, it is an indication of heavy usage from PHP - in this occasion, I would change PHP limits, or increase RAM, whatever fits your needs.

Too much usage of RAM by PHP can be caused for example by nextcloud instance, which can be very heavy when it comes to PHP and RAM

I’ve reduced memory usage alot with this setting
pm = ondemand
pm.max_children = 60
pm.process_idle_timeout = 10s
pm.max_requests = 200

I add to the template.
Then on each server disable and then re-enable php.

That’s probably a good start on the problem. And, yeah, that’s the right way to get rid of unused PHP versions, just make sure no virtual servers are using a given version before removing it.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.