In our last article, we covered .htaccess which can be draining your preformance without you realizing it. The number of requests dropped 10x or more just from blocking a few IPs. In today’s article, we will be looking at more sources of performance drains in your website.
* MySQL legacy tables
When MySQL upgraded from MySQL 5.7 to MySQL8, the query_cache feature was depreciated. As a result, MyIASM tables no longer support memory caching slowing them down making your sites drag. This lowers your search engine position and may cause more speed sensitive visitors to find a different a site.
In the past, query_cache would save limited queries into memory to speed up repeated queries for the same data. WordPress sites could use this to speed up content such as the main page which is visited very often. You can read more about it here: https://dev.mysql.com/blog-archive/mysql-8-0-retiring-support-for-the-query-cache/
To test if you have any of these legacy tables, log into Webuzo and click phpMyAdmin under Database. At the top, click SQL before clicking anything else. It is important you click SQL on the main screen to check all databases at once. Paste the following into the Query Box at the top (beside the 1).
SELECT table_schema, table_name, engine
FROM information_schema.tables
WHERE engine = ‘MyISAM’
AND table_schema NOT IN (‘mysql’, ‘performance_schema’, ‘information_schema’, ‘sys’);
That will return a list of all tables that are slower than they need to be. These tables will never cache anything in memory. It is a massive performance drain.
To convert these, you can use phpMyAdmin after taking proper backups.
Note: Do NOT proceed without fresh backups you have tested and are able to restore.
The following will generate SQL queries for you to run to convert the tables:
SELECT CONCAT(‘ALTER TABLE `’, table_schema, ‘`.`’, table_name, ‘` ENGINE=InnoDB;’) AS query
FROM information_schema.tables
WHERE engine = ‘MyISAM’
AND table_schema NOT IN (‘mysql’, ‘performance_schema’, ‘information_schema’, ‘sys’);
If you have too many to convert this way, contact support for assistance. We’re happy to help you convert legacy data over to ensure your sites are as fast as possible.
* Old PHP version
Newer PHP is much faster and more efficient than older versions with support for many new features. Is your WordPress website running the latest PHP 8.2+ on the server? If not, you could be losing valuable speed to an older slower interpreter.
You can check several ways such as:
Log into Webuzo, click MultiPHP Manager under Configuration, and look at the PHP version assigned.
You can also upload a file named something with secure random characters such as SDfhsdjkhfwo924802.php with the following included:
<?php
phpinfo();
?>
This simple script will output detailed information about your PHP environment. After viewing the information, remove the script. The random name is to secure it against any spiders from attempting to look at it while you are working with it.
* Calls to external resources
Are you using external news feeds or similar information pulled from another website? These can significantly slow down your website if they are updated on page load instead of via cron. Many plugins support both modes of operation. The default is update on page load as it works out of the box. Unfortunately, this is very slow.
Check your plugins to ensure they are caching external data feeds and updating via cron instead of on visitor page load. Sometimes slow search engine spider results lowering your rank in Google are due to problems just like this
In the next edition, we’ll take a look at more ways to optimize and harden your WordPress website. Let us know if you have any questions or suggestions!