Multiple processes for the same wordpress site?

SYSTEM INFORMATION
OS type and version Ubuntu Linux 24.04.1
Virtualmin version 7.30.2

I am trying to troubleshoot an intermittant server crash that is happening on my virtualmin server every few days. I notice that RAM gets higher and higher until it tops 80% and some time after that the crash happens

My main suspect in this is wordpress, which I installed via the Virtual Min manage applications i.e. the standard VirtualMin way. There seem to be 4 or 5 running processes for the same WP site? At 200 odd Meg this adds up pretty quickly

Why are so many processes needed to run a single WP site?

Also - any tips etc for how to investigate and resolve this kind of problem would be much appreciated

Because more than one connection is happening at any given time. The internet does not wait its turn in a line, so one process alone can’t serve the website for all those users. (Even a single user can generate many simultaneous requests.)

You’re overestimating how much memory is being consumed, though. All php-fpm processes for the same version of PHP will share quite a bit of memory, because they’ll all be loading a bunch of the same shared libraries (this is the same with a lot of other stuff that fires up multiple processes, if you’re simply adding them all up, you’re overestimating memory used by a lot).

80% usage is expected.

https://www.linuxatemyram.com/

It’s possible you are running out of memory, but 80% usage does not indicate that to be the case. You should check the kernel log (dmesg or the journal) for Out Of Memory errors. If you see those, you are definitely running out of memory.

Also, what does “server crash” mean here? Is the server itself literally crashing? If so, that has nothing to do with memory, or any software you have control over. A server crash indicates hardware or kernel bugs. Nothing in user space can crash the server, without something in hardware or the kernel failing. But, if you just mean, “the website isn’t responding”, that’s a different issue, with different troubleshooting steps, and we need to differentiate between them.

Thank you Joe that is very helpful. Yes I was just adding up the numbers of memory. Plus the 80% thing is good to know

The server crash is a full crash, the server is completely unresponsive and I can’t reach it via virtualmin and I can’t even SSH into it. I go into the AWS console and restart it which brings it back up

Do you have any advice on where to start? I haven’t been able to link the crash with any particular event on the server, it is not taking production load at this point so there isn’t anthing obvious like massive backups, high web traffic etc. And I guess even if these were present they wouldn’t necessarily lead to a full on crash

Then it’s either a firewall gone rogue (check fail2ban logs to see if you’re locking yourself out somehow), or the system is literally crashing, and there’s little you can do about it
your AWS VM is broken. You should make sure your OS is up to date, and if that doesn’t fix it, and if you can’t find any clues in the kernel log about why it’s crashing, you’ll need to take it up the chain to someone who can help (we can’t, Amazon is selling you an unreliable system, it seems).

As I said, nothing in user space should be able to crash the kernel. If it can, it’s a kernel bug or a hardware bug. Even an out of memory event (which is catastrophic for user processes that must be killed to keep the system running) shouldn’t be able to crash the system
the kernel will kill whatever it needs to in order to keep running. It’s possible it would kill every means if getting in, but it seems unlikely unless something is really running away with memory and also working really hard so the kernel thinks it’s the most important thing. So, maybe the kernel killed Webmin and the ssh server. But, if you can’t get in via the AWS serial console, it really is dead. If you haven’t tried getting in via the AWS serial console (or whatever they call it, I assume there is some way to see the actual console, basically a virtual KVM for a virtual machine), you should try that before deciding it’s definitely crashed. It may just be ssh and Webmin have been slain by the OOM killer.

You might find that taking a snapshot, shutting it down and bringing up a new VM from the snapshot, maybe in another region or with different specs, might get you better reliability. If AWS is having hardware troubles and you’re unlucky enough to be stuck with a failing system they haven’t caught yet, that might be a solution.

That quiet large, pool sizes. Are you running Dynamic?
I switched to ondemand and found a big drop in memory usage.
I’ve posted this many times but seems people don’t take much notice.
Here what I settle on in the php template.
If the site is idle the pools will disappear until new activity.

1 Like

is that screenshot complete and accurate, or just an example?

I ask because my wordpress sites using php-fpm routinely will have 3-4-5 php-fpm (child) processes running all the time, with no issues.

in general we have seen other php-fpm issues where the config allows 20-50-100 child processes, which many systems cannot handle – one solution to THAT is to limit the number of child processes to a level the system CAN handle.

Thats my template
this is ondemand not dynamic. maybe just try one site.

Thanks for that. It may not be the root cause but good to know and I will try it

OK thanks. AWS does have what they call a serial connect but its only available on nitro instances which mine isn’t Also they have what they call and ‘instance connect’ which I am not sure exactly what that is.

In any case when it happens again I’ll try to connect via the AWS console as first port of call

Also will check the fail2ban logs

Thanks

I mean, a virtual machine would not have a literal serial console, but it would be a virtual equivalent. I just don’t know what it’s called for AWS. But, I believe they all have a way to login to a console that doesn’t use ssh and connects directly to the “screen” that the kernel is producing, which should be immune to the OOM killer, since it is literally part of the kernel.

I’ve never had any luck installing on them, always locked up during install.
What Instance type did you install, I’ll have another go.

Its a T2 Medium. I’ve installed VirtualMin on a few AWS instances now (latest Ubuntu OS) and they have all gone without a hitch

This is how AWS does it. So mine is not a nitro. I may upgrade temporarily if that is possible

Conveniently the server has crashed an hour ago, and is still down, so plenty of data to explore!

finally got one installed, but can’t connect via virtualmin in browser, must be a firewall at aws.

Yes your security group needs to have port 10000 open

1 Like

How do you root login with webmin

That’s always true of all services at AWS. You must explicitly open all the ports you need (except ssh
maybe they all 80/443 by default, too). Nothing to do with Virtualmin.

You either set a root password (sudo su - root and then run passwd) or login as your sudo-capable user instead. Same as any other system that doesn’t have a root password after OS installation.

But, this is off-topic. Please open a new topic for any further discussion about running Virtualmin on AWS. FAQ - Virtualmin Community

1 Like

I’ll restore my current system to it and see how it behaves.