Follow

Troubleshooting high admin-ajax usage

  • Applies to: Grid
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Wordpress admin-access, Account Center access
  • Applies to: DV
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Wordpress admin-access
  • Applies to: WordPress Hosting
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Wordpress admin-access

Overview

The following article provides information on how to diagnose and troubleshoot high server usage from admin-ajax.php. By itself, the admin-ajax file has practical applications for your website. It's often involved with plugins, auto-saving, session management, and notifications.

However, if left unmanaged, the file may eventually start using up unnecessary CPU and load on your server. This can potentially result in a slower site or resource overages.

STATEMENT OF SUPPORT:
Please keep in mind that troubleshooting the configuration/functionality of third-party applications is not covered by our statement of support. These resources were provided as a courtesy to assist you to the extent of our abilities. For more information on our statement of support, feel free to click here.

Tools

A good place to start is running a few speed tests on you website. Some popular free third-party tests you can use include: Pingdom, GTMetrix, and the Google Chrome Dev Tools.

 

For legacy Grid users, another helpful resource is the GPU tool. This will allow you to take a look at all the sites on your server and narrow down which ones are using the most resources.

ac-1.png

 

Diagnosis

In this example we will be using GTMetrix, as it allows us to see POST data.

  1. Go to https://gtmetrix.com and search your domain's URL.

    Be sure to change example.com to your actual domain name.

    GT-new-01.png

  2. After a few minutes, GTMetrix will provide your test results. Click on Waterfall.

    GT-0.75.png

  3. Scroll through the Waterfall until you find admin-ajax.php.

    You may notice looking at the purple graph that the admin-ajax is significantly slower than the rest of our site.

    GT-1.png

  4. Click on the admin-ajax data entry. Then click on the POST tab.

    GT-2.png

  5. The results in the POST tab will look different for each website. But in this example, what we found is "action=tve_dash_front_ajax." This line of code is telling us the application that admin-ajax.php is calling for.
  6. By looking up "tve" and "WordPress" in Google, we were able to find out this is coming from a third-party plugin, and thus we have found the culprit of our high usage.

    GT_3.png

Troubleshooting

Third-party plugins are the most common reason for for high usage by admin-ajax. Once you have found a culprit plugin, to lower your usage you can try:

  • Updating the plugin.
  • Disable the plugin (if you don't need it).
  • Contacting your developer, or the plugin's support team to see if they can advise different settings to change in your plugin.
  • Moving or upgrading to a different server that will have more resources for your plugin.

Heartbeat API

A less common, but possible contributor to high admin-ajax usage is the WordPress Heartbeat API. As mentioned earlier, the admin-ajax contributes to things such as autosaving, which by default occurs every 15 seconds. This can potentially add up and start taking up your servers resources. Usage coming from the Heartbeat API may not show up in front-end speed tests like we found in earlier using GTMetrix.

  1. A way to remedy this is by installing the Heartbeat Control plugin.

    wp-1.png

  2. After installing Heartbeat Control, go to Settings >> Heartbeat Control Settings.
  3. You can allow or deny Heartbeat under certain circumstances, or you can modify the frequency from the default of 15 seconds, to something higher such as 60 seconds. This will help lower the usage that can occur through the Heartbeat API.

    wp-3.png

The exact settings you will want to use can vary depending on your site. So for best practices you can consult your web developer on which options are best for you.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk