r/ProWordPress • u/GFXAi • 16d ago
Wordpress+ Woocommerce CPU Spike with low traffic?


I have a client whose site is built on woocommerce + woodmart theme + Elementor, approx 50 plugins with litespeed optimization enabled. I disabled guest optimization as it was adding load to CPU. Previously CPU usage was touching 100% every hour despite having low traffic. I tried query monitor , New relic logs but could not find any solid lead . Can any one suggest any method to fix this ? Admin-ajax.php is showing in log. I am using cloud 4GB ram.
0
Upvotes
3
u/Illustrious-Sir2452 14d ago
100% every hour with low traffic smells like scheduled jobs, not visitors. WooCommerce's Action Scheduler and most plugin crons run on WP-Cron, which fires off page loads (including admin-ajax heartbeats). Check WooCommerce > Status > Scheduled Actions for a pile of pending or failed actions, and use WP Crontrol to see what is set to run hourly. If that is it, set DISABLE_WP_CRON in wp-config and run wp-cron from a real server cron every 5 minutes so the jobs stop stacking up on one request.
1
u/PeepSoWP 16d ago
The first screenshot shows request counts, so 43% for admin-ajax.php doesn't establish that it uses 43% of the CPU. That endpoint serves many different callbacks. I'd narrow down one spike before changing more settings.
Ask for the AJAX
actionvalues associated with the slow requests, their durations, and one slow PHP trace from the same interval. WordPress dispatches those requests by action. Timeget_refreshed_fragmentsseparately too, since it is another large group in your screenshot.Then compare that interval with due cron/Scheduled Action hooks. An hourly pattern is a clue, but it doesn't prove cron is the cause. Can New Relic show a transaction trace during a spike, rather than only the aggregate URL list?
1
u/toniyevych 2d ago
It's impossible to tell what exactly goes wrong having only those two charts. If you have access to the server's console, I suggest checking what loads the CPU using commands like top or ask support to check.
Aside from that, I'd start with setting up a Query Monitor and checking database queries and external HTTP requests.
0
u/Suspicious_Quote1268 16d ago
Same problem. Same setup.
Fixed with Changing PHP Versions and Installed Modules in the cPanel.
For me it was spiking when trying to update a page or loading the /wpadmin.
-1
u/SayedAkhtar_ 16d ago
It's most probably an issue with the recent PHP bug update your installation to the latest php version and check of any open vulnerability of the installed plugins.