How to Resolve “My web page does not load” because of High Resource Consumption in WordPress

I>How to Resolve the High Resource Consumption of WordPress

How to Resolve the High Resource Consumption of WordPress Admin-ajax.php Process


WordPress Heartbeat
is an API introduced in version 3.6 back in the days. This API simulates the bidirectional connection between the client browser and the server where the WordPress site is hosted. The API features many implementations but the most important are:

  • Live communication between the client’s browser and the web-server with Ajax (no web page refresh needed)
  • Improved user session management
  • Tracking of different post revisions
  • Auto-Saving posts

With such features, it is undoubtedly quite a handy tool that is fully enabled by default in WordPress.

The Problem

Recently we discovered that due to the Heartbeat functionality, our Shared Hosting clients are experienced a major issue with the resource consumption of their websites. It appears that in order for the WordPress Heartbeat to work properly, it spawns an additional admin-ajax.php process, which is making the Ajax requests to the index.php file of the wp-admin section.

Here is a simple example:

00:45:11 "POST /wp-admin/admin-ajax.php "http://example.com/wp-admin/index.php"
00:45:67 "POST /wp-admin/admin-ajax.php "http://example.com/wp-admin/index.php"

This is resulting in the constant spawn of new admin-ajax.php processes which are consuming quite a lot of resources:

503 user 20 0 358m 33.8 0.2 0:00.35 /home/user/public_html/wp-admin/admin-ajax.php
508 user 20 0 387m 25.1 0.4 0:00.79 /home/user/public_html/wp-admin/admin-ajax.php

The amount of spawned processes sometimes exceeds the number of allowed processes on our Shared Hosting environment, and this is resulting in 508 – “Resource limit reached”. This error can also be received if there is no CPU/RAM available for your account. That can happen because it has reached the virtually assigned limits or the hardware limitation in case you are using a service like our Dedicated Servers.

The Solution

The only common solution applicable by every WordPress user is actually quite a simple one – You need to either disable the Heartbeat API or you need a way to control it.

To control the API, you need to be fully aware of what it does, and also you should be well familiar with the code and the functionality of the WordPress application. In case you do not have the time to spare in order to check all the whitepapers, you should read the next few lines of this post.

The simplest and most effective solution to this issue is to install a plugin called Heartbeat Control. If you are not quite sure how to do that, please check our “Managing the plugins of your website” tutorial, where you will receive detailed and well-structured information on how to perform plugin installations.

Once you install the plugin, you will need to activate it, and then an additional item named Heartbeat Control will emerge into the Settings menu of your WordPress application.

It fully support the suggested fix, and we will gladly apply it for any customer of our services who would like to boost the performance of the used WordPress application.

Leave a Comment

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