Virtualmin starts off with <40% memory usage, however, after about 3-5 days it eventually increases to almost 100%

7 posts / 0 new
Last post
#1 Wed, 05/01/2019 - 04:20
adamjedgar

Virtualmin starts off with <40% memory usage, however, after about 3-5 days it eventually increases to almost 100%

I have had so many problems lately, my queries are now ranking highly on google, quite a few on page 1!

Anyway,

If i reboot my system, my usage stays relatively stable at around 40-50% RAM usage. However, after a number of days, the amount being used continues to gradually climb bit by bit until almost 100% RAM is used up and Webmin also becomes inaccessible.

Any attempt to reboot from ssh with the command "Reboot" also fails due to a lack of memory. So in order to reboot i have to use something like "systemctl reboot".

Any ideas on problem solving the memory usage climbing and not settling down again? I have looked in apache logs but they dont appear to shed any light on this for me.

Wed, 05/01/2019 - 10:39
andreychek

Howdy,

Hmm, it sounds like you're saying your server as a whole is running low on RAM, rather than just Virtualmin.

How much RAM does your server have? You can determine that by running "free -m".

What you may need to do is run a "ps auxwf", and look to see what process or processes are using a lot of RAM... maybe even compare that to a "ps auxwf" that you run just after a reboot.

You can also run "top", and press "M", to sort process by memory usage.

Depending on the settings being used, MySQL is capable of growing fairly large. If that's the case, you may want to re-run the post-install wizard, and select a configuration for a smaller memory footprint. You might want to set it for the smallest, 512MB, until your memory issues are all sorted.

Bots are also capable of hitting a website hard enough that they could cause it to spawn too many PHP processes. If you're finding that's the case, you could try limiting the number of connections to Apache... that's often with the Apache "MaxServers" option (depending on the Apache MPM being used).

Those are just a couple of options though, the key is to review the processes running on your server, and determine what's using up memory on your server.

-Eric

Mon, 05/06/2019 - 20:19
krembo99

I do not intent to "kidnap" this post, but I have the same problem posted on another thread https://www.virtualmin.com/node/65721 .

In my case in is a clean install with no websites, only two users, one domain, no mail etc.. new empty server.

Looking at the processes the biggest memory hog is fail2ban apparently - which was left at default and untouched since install. You should defiantly look at the processes, but how to really fix the problem is still a mystery.

Temp ( and bad ) solution might be to schedule a reboot of virtualmin every day to clean the memory - at least until identifying the culprit

Mon, 05/06/2019 - 21:25
andreychek

It's not unusual at for processes to use more memory over time, though they usually do level out. However, if you're running out of RAM, that indicates that you either don't have enough RAM, or you need to disable some of the services that are being run.

You mentioned Fail2ban, for example -- that's an optional service. It's a nice feature, but it's not needed. If it's using too much RAM, then you can disable it. If you really want to be able to run it, then it may just mean your server requires more RAM than it has available.

-Eric

Mon, 05/06/2019 - 22:46
krembo99

In my case, real memory ( RAM ) does not seem to be the problem, it is steady on about 30% of the total 1gb .

Tue, 05/07/2019 - 05:05
adamjedgar

so if we disable fail2ban, and i have about 6 Virtual servers on the webmin system (3 Wordpress virtual servers, whmcs and blesta virtual sub servers, and 3 static html sites), what am i going to use to help protect the other virtual servers?

Is adding security plugins (ie All In One Wordpress Security or Wordfence) at the Wordpress level good enough to replace fail2ban?

I suppose the way to know is to try it and see what happens to my logs...if they start filling up with failed login attempts i will know i need to restart fail2ban (providing my server doesnt get destroyed first)

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Tue, 05/07/2019 - 06:15
krembo99

I can only comment about wordpress, and about my situation withfail2ban:

Is adding security plugins (ie All In One Wordpress Security or Wordfence) at the Wordpress level good enough to replace fail2ban?

No. Wordpress plugins might protect the website itself ( wp ) but not the server. Ftp, SSh, db, mail etc etc are not a part of wordpress...

No plugin that is a part of wordpress can actually protect the whole server. Just ( maybe ) wp itself. That being said - more protection is always a good thing - providing that the plugins really do what they should. ( you can also use the simple 6G firewall - it works with .htaccess - but again - not a server wide solution ). If you still want fail2ban there is a wp-fail2ban plugin that can help manage it but you still need to have it installed and running .

so if we disable fail2ban, and i have about 6 Virtual servers on the webmin system (3 Wordpress virtual servers, whmcs and blesta virtual sub servers, and 3 static html sites), what am i going to use to help protect the other virtual servers?

Regarding fail2ban - my comments above were specific to my situation. you should examine your own processes. fail2ban by itself is probably not the problem. I used it on other systems without any trouble. The sympthoms described appeared ( for me ) only on virtualmin,

If you do choose to disable fail2ban - make sure you have some other system to ban bad requests or firewall , likeiptables, firewalld etc ..

For the rest we would need to wait for some advice from a virtualmin pro..

Topic locked