How to get more info on cause of high-CPU usage during high-traffic?
-
Hey all.
Okay so I have a WordPress website that has a decent amount of traffic, both guests and logged-in users. (Logged in users not served cache pages). I use WP Super Cache. The site is very dynamic (main purpose is file downloading, rating, sharing, Buddypress section, etc.) It’s quite large and active at all times.I’ve taken an initiative on optimizing the basics of the site as best I can (much of it is run by a custom-written plugin done by myself) but I use a few third-party plugins as well (the aforementioned Buddypress, for example)
Anyway.
At any given time the site runs fine. But at “high traffic times” (weekends, etc) the site is constantly at >100% CPU usage and is very, very slow.
To add to the confusion, at similar “high traffic times” the site load is not necessarily high at all. It seems to come and go, but is typically associated with high volume of traffic.
Point is, it’s quite sporadic. And can last for a few minutes to hours to maybe the entire day is just “high” CPU usage.
Before I throw in the towel and just ask my host to up my CPU power, I’d like to try to narrow it down. How can I do this? I’m not too adept with server maintenance, but hypothetically for example, maybe I can tell phpmyadmin to “log all queries for the next 30 minutes and rank them by number of times they’ve run and just how much CPU impact they’ve caused” etc. Whether or not that’s a “thing” idk but that’s what I’m asking here – what can I try to attempt to figure out the source of these slowdowns?
(I have tried disabling plugins here and there, but it’s hard to do with how dynamic and mashed together the plugins are with each other. Disabling one thing kinda interferes with something else or worse.)
(I’ve also used plugins like Query Monitor and gone around the site optimizing and fixing any “slow queries” I’ve found, well, as much as I can. It’s not the same, though. This issue happens on a LIVE site, with large traffic. Me on a test installation or as a single user is not the same environment. Besides, I may just not happen across the queries that are causing the issue.)
Running of “htop” just in case useful info: https://i.imgur.com/8eqDw4P.png
- The topic ‘How to get more info on cause of high-CPU usage during high-traffic?’ is closed to new replies.