Summarize memory processes per website using the command similar to Virtualmin UI

SYSTEM INFORMATION
OS type and version Ubuntu
Webmin version Latest
Virtualmin version Latest as per Virtualmin
Related packages Automatic updates enabled

Is there a clever command line script to summarize memory usage per website username?

Or even better, is there a bulk way to change the number of PHP sub-processes to 16?

This summation is already done in the Virtualmin UI as the the screenshot below. When you click on the Dashboard and Virtual Memory you can see in the Memory tab all the processes. But I need a summary.

To our horror we have discovered some of our websites on our shared server doesn’t have the default of 16 anymore, rather stuck on 9999. Under normal circumstances this didn’t seem an issue until one fairly idle website spawed 1000s of processes and started using 12 GB of memory.

So I was hoping for a command line version of what the UI does so that I can go and easily spot check any that has more than 16 open on our running server.

How to simulate and summarize the screenshot below?

There are a few great tools for examining utilisation;

htop, probably the best CLI based utilisation tool.

iotop, like it says a way to examine processes using disk io.

iftop, like it says, a way to monitor network connections, like a live netstat.

smem, a better tool for examining memory usage.

You can use your package manager (yum / dnf /apt / dpkg etc) to install these. Most, if not all have man pages.