How to Fix a 4s+ admin-ajax.php Delay (CPU Steal vs Plugin Issues)

Affiliate Disclosure: Some links on this page are affiliate links. If you purchase through these links, I may earn a commission at no extra cost to you. Learn more.

How to Fix a 4s+ admin-ajax.php Delay (CPU Steal vs Plugin Issues)

Have you ever clicked Save or Update in WordPress and watched a spinning wheel turn for 4, 5, even 8 seconds? That agonizing wait almost always traces back to a single file: admin-ajax.php. Before you start deleting plugins or blaming your host, you need to know exactly what is causing the delay. In this guide, I will walk you through a systematic approach to diagnose whether the culprit is a misbehaving plugin or CPU steal from your hosting provider. By the end, you will have actionable steps to restore snappy admin performance.

What admin-ajax.php Actually Does

admin-ajax.php is WordPress built-in handler for asynchronous requests. Every time your post autosaves, a widget refreshes, or a page builder updates in real time, admin-ajax.php processes that request behind the scenes. It lives in your wp-admin directory and acts as the bridge between your browser and the server, enabling dynamic interactions without full page reloads.

Under normal conditions, these requests complete in under 500 milliseconds. The problems start when plugins fire excessive AJAX requests, run inefficient database queries, or when your server lacks resources to process requests promptly. Understanding this mechanism is crucial because it tells us where to look when things go wrong.

Plugin Issues vs CPU Steal: How to Tell

Not all delays are created equal. Plugin-related slowdowns typically appear during specific actions like saving posts or using page builders. They happen consistently and correlate with particular workflows. CPU steal, on the other hand, manifests as sporadic delays across all admin-ajax operations, often worse during peak hours.

The key difference is consistency. Plugin issues are usually intermittent and tied to specific actions, while CPU steal creates a persistent slowdown regardless of what you are doing. Understanding this distinction determines your fix strategy, as the solutions are completely different.

Diagnosis Step-by-Step

Check 1: Browser DevTools Network Tab

Open your WordPress admin and press F12 to open DevTools. Click the Network tab and trigger the slow action. Look for admin-ajax.php requests in the list. Click any request to examine the Timing breakdown. If Waiting (TTFB) exceeds 4000ms, your server is struggling to generate the response. Check the Payload tab to see which plugin triggered the request.

Check 2: CPU Steal Detection via SSH

SSH into your server and run this command to check CPU steal:

top -bn1 | grep "Cpu(s)"

Look for the st column (steal time). Consistently seeing values above 10% indicates your host is overselling resources. Values above 30% explain why admin-ajax.php crawls. Run this command multiple times throughout the day, especially during peak hours, to confirm the pattern.

Check 3: Query Monitor Plugin

Install Query Monitor from the WordPress repository. Once activated, it adds a toolbar showing query count and execution time. Trigger a slow admin-ajax action, then check the AJAX section. Look for slow queries taking over 100ms, duplicate queries, and which plugins triggered them. Query Monitor reveals exactly which functions are causing delays.

Fixing Plugin-Related Issues

Once Query Monitor identifies the problematic plugin, start with the toggle method. Deactivate all plugins, then reactivate them one by one while monitoring admin-ajax.php timing. When latency spikes, you have found your offender.

For plugins relying on the WordPress Heartbeat API, throttle the frequency by adding this to your functions.php:

add_filter( 'heartbeat_settings', function($settings) {
 $settings['interval'] = 60;
 return $settings;
} );

This changes the Heartbeat API from its default 15-second interval to 60 seconds, dramatically reducing admin-ajax.php calls. Consider Perfmatters for granular control over Heartbeat across different admin screens.

Fixing CPU Steal and Hosting Issues

If CPU steal is your diagnosis, no plugin cleanup will help. You are on shared or virtualized hosting that is oversold. The only solution is upgrading your infrastructure.

Cloudways provides cloud-based VPS with guaranteed CPU allocation and no steal time. Resources are dedicated to your instance and you can scale vertically in minutes. Rocket.net offers edge-cached WordPress hosting with virtually unlimited CPU resources and enterprise-grade infrastructure. Both eliminate the noisy neighbor problem entirely.

SymptomPlugin IssueCPU Steal
TimingIntermittentConsistent
PatternSpecific actionsAll admin-ajax calls
Peak HoursConsistentWorse during peak
FixOptimize or replaceChange hosting

Conclusion

Slow admin-ajax.php requests stem from either plugin inefficiency or CPU steal. Use DevTools for initial diagnosis, SSH for CPU verification, and Query Monitor to pinpoint plugin culprits. Fix plugins by optimizing or replacing them; fix CPU steal by upgrading to quality managed hosting. Your WordPress admin will thank you.

What is your experience with admin-ajax.php slowdowns? Share which diagnostic step revealed your culprit in the comments below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *