My site feels slow. Measure where it comes from before we change
anything, and show me what you measure.
"The site is slow" is not a diagnosis. It can be the server, your account, your PHP version, your cache, your database, a bot or a plugin. Start fiddling in a random order and you change three things without knowing afterwards which one helped.
We always work through the same eight layers, from the outside in. The first two together take a minute and immediately remove half of the possible causes. Below is what you measure per layer and what you can have the assistant do.
1. Measure: is it the site or the network?
Ask three times for the time to first byte on a normal page, and then on one static file from your site, for instance a JavaScript file from the WordPress folders. If the static file is fast and the page is slow, it is on the site side and you no longer need to look at your connection or the server.
In the same measurement, look at the cache-control header your page returns. If it says no-store or no-cache, no page is being cached and WordPress rebuilds it for every visitor. That alone is already an explanation.
Measure the TTFB of the homepage and of a static file three times,
and show me the response headers of the homepage.
2. The server
Look at the load on the machine and the number of PHP processes waiting. On our servers each account sits in its own fenced off space, so a busy neighbour does not explain your slow site. A server hitting its own ceiling does, and then it is a question for us and not for you.
3. Your account's limits
Every hosting account has a limit on memory and processes. Hit it and processes get cut off, which you see as a slow site or an error message, not as "out of memory". Check whether there are limit faults at exactly the moments the site gave up.
What those limits are and how you see you are up against them is in memory and process limits per hosting account.
4. PHP version and OPcache
This is the layer that most often yields the most and is most often skipped.
Run the newest stable PHP version your plugins can handle. The difference between PHP from a few years ago and the current one is clearly visible on a WordPress site with a page builder, and it costs you nothing.
And switch OPcache on. Without OPcache, all PHP code is read and compiled again on every visit. With us it sits in the PHP menu of your hosting panel, under the extensions. If you do not know whether it is on, have the assistant check.
Which PHP version is this website running, is OPcache on, and what can
safely move to the newest version?
Note: you set the PHP version and the memory for your site in that PHP menu, not in an .htaccess. Set it in two places and the wrong one wins.
5. Memory inside WordPress itself
There are two memory limits and they get mixed up. There is the memory PHP is allowed to use, and there is WP_MEMORY_LIMIT in your wp-config.php, with which WordPress limits itself. That last one is 40 MB by default, which is too little for a modern site with a page builder.
Check what WP_MEMORY_LIMIT is in wp-config.php and set it to 256M if
it is lower.
6. Traffic and bots
Look at the traffic of the last 24 hours: how many requests, how many unique visitors within those, and the top addresses, user agents and paths. A hundred requests a minute from one address to the same search page is not a visitor.
One warning from experience: before you block anything, check that the top address is not yours. Somebody working in the admin area or a page builder all afternoon looks like a bot.
7. Reading the log lines, and knowing what they do not mean
The web server's error log contains lines that sound alarming and say nothing. The best known is the message that a request was aborted while zero requests were processed. That means: the visitor broke the connection. That is the symptom of a slow page, not the cause. Do not go hunting there.
8. The WordPress layer
Only now do we go inside:
- Is there a cache plugin, and is it active? On our servers that should be the LiteSpeed cache plugin, because it works together with the web server instead of alongside it.
- Which theme and how many plugins are switched on? The number is not the problem, one plugin that calls out on every visit is.
- How big are your tables? If
wp_posts,wp_postmetaandwp_optionsare out of proportion, they usually hold page builder data and years of revisions.
Show me the active plugins, the theme, and the ten biggest tables in
this site's database.
The order to report it in
If you do this for somebody else, report it from the outside in: first that the server and the account are clean, then the bot traffic, then an explanation of the log lines, and only then "where it actually is", numbered. In that last list we almost always have the same four points: PHP version and OPcache, the page cache, the database with revisions, and the plugin stack.
Common mistakes
Starting with a cache plugin. A cache hides a slow page from new visitors. Logged in visitors and forms notice nothing of it.
Changing three things at once. Measure, change one thing, measure again.
Forgetting OPcache. It is one checkbox and it helps on every page.
Reading the aborted request line as the cause. That is the visitor who clicked away.
Blocking your own address as a bot. Check who the top address is first.
Raising PHP's memory and leaving WP_MEMORY_LIMIT alone. Then WordPress still holds itself back.
What else the assistant can check for you is in checks for DNS, email, SSL and speed. If you are working on updates, have a look at safely updating WordPress too.