Monitoring Cpu Usage: Optimizing Wordpress Performance

how to monitor cpu usage wordpress

WordPress is a content management system written in PHP. This means that the content it serves is generated dynamically by a set of PHP scripts. Every time a visitor arrives at your website, WordPress processes the request and generates a response. Responding to a request implies a certain use of server resources.

One of the strong points of WordPress is that more features and functionality can be added with the help of plugins. However, the more plugins you install, the more CPU resources your site consumes.

- Use a plugin like P3 (Plugin Performance Profiler) to identify which plugins are slowing down your site.

- Remove unnecessary plugins.

- Configure WP Disable to disable certain WordPress settings that consume unnecessary CPU cycles.

- Optimize images by removing metadata.

- Limit the number of crawlers on your site.

- Limit the crawl rate for Google and Bing.

- Clean your database to remove any unnecessary information.

- Avoid high CPU usage plugins like Jetpack, SumoMe, and Visual Composer.

Characteristics Values
Plugins to monitor CPU usage P3 (Plugin Performance Profiler), Memory Viewer, Debug Bar
Plugins to reduce CPU usage WP Super Cache, W3 Total Cache, FlyingPress, Perfmatters, Unbloater, WP-Optimize, Blackhole for Bad Bots, WPS Hide Login
Other ways to reduce CPU usage Remove unnecessary plugins, configure WP Disable, optimise images, limit Google and Bing crawl, clean database, avoid high CPU usage plugins, lazy load images and videos, increase PHP memory, disable cron jobs, turn on Keep Alive service, outsource comment system, disable hotlinking, enable http/2 and OCSP stapling, disable .htaccess

shundigital

Remove redundant plugins

The more plugins you install, the more CPU resources your site consumes. Therefore, it is important to remove any redundant plugins.

Firstly, identify which plugins are causing the most load on your site. You can do this by using the P3 (Plugin Performance Profiler) plugin from Godaddy, which allows you to see a breakdown of which plugins are causing the most load on your site and when during a standard page request. Once you have identified the most resource-intensive plugins, you can then remove them.

Another way to identify resource-intensive plugins is to use the Memory Viewer plugin, which allows you to view WordPress' memory utilisation at several hooks during WordPress' execution, as well as statistics on time and MySQL usage.

In addition to removing plugins, you can also try to find alternatives to resource-intensive plugins or properly configure them to reduce their CPU resource usage.

It is also important to keep your plugins up to date, as this can help to optimise your site and reduce CPU usage.

Finally, remember to always back up your site before making any changes, so that you can restore it if anything goes wrong.

shundigital

Use WP Disable to reduce unnecessary CPU cycles

One of the best features of WordPress is its extensive collection of plugins that can be used to extend your site's functionality. However, the more plugins you install, the more CPU resources your site consumes. To prevent this, you can use the WP Disable plugin to disable certain plugins, reducing CPU usage.

WP Disable allows you to disable plugins either individually or in bulk. To disable a single plugin, simply click on "Plugins" in your dashboard sidebar and then click "Deactivate" below the name of the plugin you want to disable. You can also bulk disable plugins by using the checkboxes next to each plugin, selecting "Deactivate" from the drop-down menu, and clicking "Apply".

In addition to disabling plugins, you can also reduce CPU usage by removing any extra plugins that you don't need. For example, instead of using a separate plugin for Google Analytics, you can simply insert the tracking code into your theme.

By using WP Disable to manage your plugins, you can optimize your WordPress site and reduce CPU usage.

shundigital

Optimise images

Optimising images is a great way to reduce CPU usage and speed up your WordPress site. Here are some tips on how to do this:

  • Use a plugin like Imagify Image Optimizer, EWWW Image Optimizer, or ShortPixel Image Optimizer to optimise images when you upload them to WordPress.
  • Use a CDN (Content Delivery Network) to host your WordPress theme's images. A CDN hosts your images on multiple servers worldwide, delivering them to users from the server closest to them. This reduces the load on your server. Recommended CDNs include Amazon CloudFront, Cloudflare, StackPath (MaxCDN), and Jetpack Photon.
  • Remove unnecessary metadata from your images. Tools like PNG Gauntlet, Stripper, and JPEGmini can help with this.
  • Serve static content from a cookieless domain. This involves telling WordPress to serve cookies from www.your-domain.com and removing cookies from images.your-domain.com. You can do this by inserting the following code into your wp-config.php file:

> define( 'COOKIE_DOMAIN', 'www.your-domain.com' );

  • Use a cache plugin like WP Super Cache or WP Rocket Cache to optimise and compress CSS and JavaScript.
  • Optimise your MySQL database. Over time, your database can become bloated with redundant data, affecting your site's performance. Use a plugin like Advanced Database Cleaner to clean this up.
  • Manually remove redundant data from MySQL. You can use specific queries to delete "junk" entries, remove Akismet-related metadata, remove comment agent, mass-close trackbacks and pings, delete unused tags, delete feed cache, delete post revisions, and change the default 'admin' username.

shundigital

Limit Google and Bing crawl

There are several ways to limit Google and Bing from crawling your website. Here are some methods to help you get started:

  • Use the Password Protected plugin to lock down your entire site. This will require a password for anyone trying to access your site, including search engines.
  • Utilise the built-in feature in WordPress to instruct search engines not to index your site. Go to Settings > Reading and check the box next to 'Search Engine Visibility'. This will add a line to your website's header and modify your site's robots.txt file to discourage search engines from indexing.
  • Install an SEO plugin like All In One SEO. This will allow you to choose specific posts or pages that you don't want search engines to index. Simply edit the post or page and enable the 'No Index' checkbox in the AIOSEO Settings.
  • Use robots.txt to block Google and Bing from crawling certain pages or resources that you don't want to appear in search results. This is especially useful for blocking faceted navigation pages, duplicate content, soft 404 pages, hacked pages, infinite spaces, proxies, and low-quality content.
  • Return a 404 or 410 status code for permanently removed pages. This will send a strong signal to Google and Bing to not crawl those URLs again.
  • Monitor and manage your crawl budget. This involves ensuring your server has sufficient capacity to handle crawl requests and making sure your site is efficient and fast to load. Tools like Google Search Console and Google Analytics can help you analyse your crawl budget and make necessary adjustments.
  • If you urgently need to reduce the crawl rate for a short period, return a 500, 503, or 429 HTTP response status code instead of 200 to crawl requests. This will signal to Google and Bing to temporarily reduce the number of requests and crawl rate.

shundigital

Clean your database

A cluttered database can slow down your website and harm its loading times, so it's important to clean it up and optimise it. Here are some ways to do that:

  • Backup your database: Before you start cleaning your database, it's important to back it up. You can use FTP, your hosting panel, or a WordPress plugin like UpdraftPlus to do this.
  • Delete old plugins, themes, and post data: If you're not using a plugin or theme, delete them along with all their data. You can do this by going to Plugins -> Installed Plugins and clicking Delete under any plugins you want to remove. You can follow a similar process for themes by going to Appearance -> Themes.
  • Delete or limit post revisions: WordPress allows you to control how many revisions you want to keep for an article. To limit post revisions manually, add this code to your WordPress site's wp-config.php file: define( 'WP_POST_REVISIONS', yournumberhere ).
  • Delete spammy and unapproved comments: Delete spam comments immediately to avoid clutter. You can use an anti-spam plugin like Akismet to help with this. You can also use phpMyAdmin to bulk delete all spam comments.
  • Delete unused tags: If some tags become obsolete, delete them from the tags section accessible from the posts > tags section.
  • Delete old shortcodes: If you delete a plugin or decide to stop using a shortcode, your website gets unnecessarily bloated. One solution is to go manually through the list of shortcodes and delete all the unused ones. Another way is to use a plugin like Shortcodes Finder to find and optimise all your shortcodes.
  • Delete pingbacks and trackbacks: Pingbacks and trackbacks are automatic server notifications sent when your site includes a URL linking to another site. To disable them, go to Settings > Discussion in WordPress and deactivate the first two settings.
  • Delete transients: Transients are a type of temporary data cache. You can use phpMyAdmin to check how many transients are being stored in your database tables, then delete them manually from the dashboard or use the Transients Manager plugin.
  • Clean orphan data: Orphaned data can take up valuable space and clutter your database. You can use a plugin like WP-Optimize or WP Sweeper to clean orphan data, or you can do it manually using a MySQL request.
  • Optimise your database: You can optimise your WordPress database manually with phpMyAdmin or automatically with a WordPress plugin.

Frequently asked questions

There are several plugins available that can help you monitor CPU usage on your WordPress site. These include:

- P3 (Plugin Performance Profiler)

- Memory Viewer

- Debug Bar

- Query Monitor

- WP Hive

- WP-Optimize

High CPU usage on a WordPress site can be caused by a variety of factors, including:

- Too many plugins

- Resource-intensive plugins

- High traffic

- Inefficient code

- Background tasks

- Crawlers

To reduce CPU usage on your WordPress site, you can try the following:

- Remove unnecessary plugins

- Use a cache plugin

- Optimize images

- Limit crawlers

- Limit Google and Bing crawl rate

- Clean your database

- Avoid high CPU usage plugins

- Use a CDN

- Lazy load images and videos

- Increase PHP memory

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment