So, around the new year there was an update to virtualmin that gave us that “live stats” section. Well ever since then ive had to reboot my server every time i have to log in (the panel) or the page doesn’t fully load. after i reboot it loads fine. Again the next day i would have to reboot the server. So last night i decided to stop webmin via command so its not using ram when im not actively using virtualmin. wake up this morning to see the error msg “segfault” when trying to start it. then i run it again and i get “out of memory error”.
So i load up 2 websites, both are wordpress, one loads fine but errors on logging in to the admin panel. The 2nd one doesnt even load the webpage, but gives me.
“Fatal error: Out of memory (allocated 2097152) (tried to allocate 229376 bytes)”
So, maybe i need to shut down this live stat thing and stop it from running. or the docs need to update their ram requirements?
Running on CentOS Linux 7.7.1908
Webmin version 1.940
Virtualmin version 6.08
Usermin version 1.780
Authentic theme version 19.44-3
Processor information Intel® Xeon® CPU E3-1230 v3 @ 3.30GHz, 4 cores
Real memory 835.07 MiB used / 101.2 MiB cached / 2 GiB total
memory usage is fine now, but it grows by the hour. When i checked “free” before the reboot i had 330 MB of memory left.
Anyone else seeing this on their own set up? Im on a VPS for the next 7 months, and cant afford to really up to the next tier of ram.
Once you say you stopped Webmin and still had the same issue, it seems that it’s not related to Webmin in any way?
Live stats, less likely, could have anything to do with it, as Webmin process was stopped. You could disable real-time monitoring on theme’s configuration page (Webmin Configuration/Webmin Themes/Real-time monitoring options) by the way.
The issue could be cause by different PHP versions used. Try choosing the other PHP version for your WordPress app.
Another reason why this issue could happen, I think, because you allocate too little memory at the first place.
Where to look:
wp-config.php and check for and/or edit/set:
- Check for
php.ini file and check for:
memory_limit = 256M ; // or more
I would contact your provider with this question, if things keep failing.
well, further inspection told me that even when the server is on for 4 hours, the ram usage rises almost all the way to its max of 2 gigs. installing word press didnt give me the option of setting ram limits. and virtualmin installed php for me. the only ram settings virtualmin asked me was preloading modules, which i said no to so it uses less ram. plus all the features to “no” to use less ram, but leaving mariaDB at “medium”.
I shut down fail2ban (wasnt using it this time) and set usermin and virtualmin to not start at boot. rebooted server, and left it for 20 hours again. ram still raised to 1.5 GBs over time. but when i just now tried to start webmin, it started, no error, but failed when i tried to log in, it logs in, goes to the main page, but wont finish loading it up. it tells me connection is gone, so i run the start command again, it does the same thing, tries to load, but fails, connection gone. webmin will not load unless i reboot the server.
I looked into word press, i didnt find ```
I did set php memory to 256, it was set to 128. not sure if that will help webmin to load after the time the ram gets too high.
I dont really want to add another version of PHP im already on the one word press wants. plus last time i installed another PHP version it created error 500 for the existing domain when i changed it to that one.
Someone said something about "bean counters" because im on an Open VZ version of a VPS. but i have zero idea what me, as a simple user can do about any of that.
I really was happy with that same host before, and used virtualmin for 10 years with that same set up.
I dont know what else to try to check. or if theres something different with the VPS environment from last time. Nor can i move down to a 32 bit OS on the list for virtualmin as the VPS doesnt include those.
Thanks for your input.
You are welcome - well, I would searched for a cause of those crashes. It might be a difficult task actually. Try running
top command, maybe you will be lucky.
I would also read and tweaked your server’s services accordingly.
HTOP is more advanced and probably easier.
Some info but also running under CENTOS if needed, you have to install via ssh command line
If using CLAMAV ?? take a look at that config and options!
2GB is also hmm very low in combination with things as Wordpress!
We use 2 GB only for testing purpose then minimal 3GB or 4GB live for small Servers / VPS / Websites
IF PHP FPM take a look how to use php fpm “pools”
Note that increasing the mem limit of PHP can increase the overall memory usage on the system. If you’re running low on system memory it may cause these symptoms. If system memory is the problem, you don’t want to increase PHP memory limits. But, if it is PHP limits causing problems, then it’s the right thing. (But a 2GB system with a bunch of 256MB PHP processes is not going to be a happy system, especially if you’ve also got a bunch of other stuff runnning…the mail stack alone needs at least a GB of memory, mostly due to ClamAV).
But, also note that memory usage reporting on Linux can be confusing if you don’t know what it’s doing with buffer/cache…when you want to know what the actual free memory when looking at
top, you need to combine free and buff/cache. Over time buff/cache will grow, but that memory is still available to be allocated for new uses…it’s just caching on-disk data and providing buffer space for disk/network IO, etc. Performance might suffer a little if the system isn’t able to cache disk activity as much as it would like, but it won’t freeze or crash the system.
But the thing is, that i have php set to 256 MB limit, and used the post install set up for virtualmin for Mysql at “medium” (previously used small) It seems no matter what i do, the server increases the amount of ram being used till it maxes out. takes about 3 days now, a steady increase. Tho now that ive set mysql to medium, as per the post install method, i dcan still access the sites and log ins just fine.
I can paste some images from the Hypanel? or that htop says. I know my other server with the same virtualmin set up isnt doing the same thing. so maybe the VPS host is at fault here. You would think, if it was, they would know about it.
If you have other server with same setup.
Then you can have a look what is different though ?
HTOP on both show also some differencies i expect
LIMIT 256MB PHP JOE means that is per … , so more sites running that then you multiply!
Also as i mentioned above and JOE to , clamav if for mailscanning on and so on could be between 7xx and 1400MB i have seen in the past depending config / settings.
2 GB server i don’t have clamav for mail and ftp scanning , ok only testserver but then i don’t want to be disturbed by that memory low problem cause clamav.
2 GB you shouldn’t set / take MYSQL config at medium , 2 GB is almost the lowest you can run a box on!
You can try if SSD disk and make swap partion bigger. ( if not ssd you can try also but then if swapping very slow)
well, its not exact SAME, the one im having issues with is Open VZ and a 2 gig ram limit. the one i test at home with is 4 gigs, but its not increasing ram usage over time like the 2 gig one.
previously, when i set the config for mysql to take the smallest amount of ram, what would happen is it would just fail to load anything after the ram got too high. then id have to reboot the server, at least with it set this way the ram maxes out, but the website still functions. Just now i have to reboot the server if i am to start webmin (note, that leaving it on doesn’t work either as it WILL fail to load the pages and crash after log in)
Oh, and i just saw, i have clam and anything mail shut down to see if that was the issue, with that shutdown, and fail2ban also shut down, the ram still creeps up to max.
“You can try if SSD disk and make swap partion bigger. ( if not ssd you can try also but then if swapping very slow)” <<—this might be something id have to ask my Hosting Provider? I dont think id have any way to manage this. When i install the OS, (Centos 7 x64 is the only one i have avail. that works with virtualmin) all i get is the ssh log in, then i use the methods to install virtualmin after a yum update.
Oh, Swap Partitions? VPS dont have swap. so i read, or just mine never has/had swap. I go with “Into VPS”
Only have 2 sites running on this, both mysql. maybe i should make a 30 second video of what htop shows?
You sometimes can create a swap file, even if you can’t create a swap partition (Virtualmin will even try to do it automatically during installation on very small memory systems). I don’t know if that’s possible in your case, though.
Note that some providers offering OpenVZ will oversell RAM on their systems, leading to random crashes that can’t really be debugged or resolved from within the VPS. If they’re not actually giving you the amount of RAM they say they are, there’s nothing you can do but move to a host that actually gives you what they promise. I’m not suggesting that’s what’s happening here, but we’ve seen enough problems related to memory on OpenVZ (and Virtuozzo) VPS installations that I’m pretty much at the point where I recommend folks avoid OpenVZ/Virtuozzo hosts…not because OpenVZ/Virtuozzo are bad on their own, but by making it easy to oversell memory, they make it easy for hosting providers to cheat their customers without the customers really knowing what’s going on.
So… We can go ahead and close this, It seemed to be the issue of Owncloud. i removed the files and terminated the virtual server, Owncloud was just too hard to deal with on the test server so i deleted it here too. Thanks, and I never thought something a php website would casue. The ram usage is stable now and it no longer seems to increase over time. Tho as of now its only been 2 days and im still able to log into virtualmin, so thats good! Thanks for all your suggestions!