Hi folks, my googling has not been getting me information I would hope to find. The above server is running on ESX with 4 CPU and 16 GB RAM.
I am have decently high RAM usage and several times where CPU runs at greater than 80%. I’ve resorted to daily reboots which are working OK as a band-aid, but not where I really want to be.
What I’d like to be able to do is correlate mysqld and apache2 PIDs to specific sites. I’ve tried some strace commands I have found on the internet, with no real answer. Using htop, most of the users appear to be just mysql and www-data.
Any advise on tools I can use that will show me which sites are the worst offenders for CPU and/or RAM usage?
Use the htop package then sort the CPU column in descending order. Check in real time which process overloads the processor cores. If you are using a VPS/VDS and its resources are shared with someone else and you find that no process is overloading your virtual machine, then talk to the service provider.
That makes me think you’re using mod_php, which you should not do.
The web server almost never consumes much CPU, except when it’s also running your applications, which is the case with mod_php (and mod_perl, and some other mod_language) modules. You should be using php-fpm, which would show the CPU usage belonging to the user that owns the domain, at least in the configuration we use in Virtualmin.