Slow TTFB, how to debug?

You are here:
Estimated reading time: 1 min

This usually happens when there’s a lot of processing in the background.

It’s uncertain what causes this, but it depends entirely on the context of the website, where it’s hosted and what’s loaded inside. It could be a faulty plugin, or a slow query (or multiple queries) and so on.

Here’s a couple of things you can try to debug this:

Enable debugging to see if there are PHP errors in the background

Follow this article https://support.reytheme.com/kb/debugging-problems/ to enable WP_DEBUG constant, and make sure to check if there are php errors generated.

Install Query Monitor plugin

Install the Query Monitor plugin to get reports of the number of queries, duration and overall DB performance, as well as memory consumtion.

After installing you should see the reports in the top Admin bar ex: https://d.pr/i/ljABBK .

For a quick comparison, here’s a screenshot of London’s demo Query Monitor overview https://d.pr/i/XizEDC .

The basic principle is avoiding a large number of queries. In that screenshot, there’s around 480 queries given that this page loads a large header with a lot of features, WooCommerce product grids, and other various elements that may need to query the DB.

Disable plugins, one by one

Given that the issue may come from a specific or multiple plugins, try disabling plugins one by one (and refresh in the meantime) to see if there are improvements.

I recommend keeping active only Query Monitor, WooCommerce, Elementor and Rey Core, and gradually activate the other plugins one by one until you can spot the one(s) that could add a bigger payload.

You can try disabling Rey Core plugin too, but please know that this plugin acts as a pipeline in many situations and a lot of content passes through it (eg: main content, product grids elements, Global sections – Header, Footer, etc.) and while disabling it will obviously show a decrease in consumptions and queries, but only because this content is not rendered anymore.

Use Redis or Memcached

By definition, Redis and Memcached are both in-memory data storage systems. Memcached is a high-performance distributed memory cache service, and Redis is an open-source key-value store.

It’s probably best to ask your hosting support team if any of them is supported on your server.

Was this article helpful?
Dislike 0
Views: 314

Suggest article improvements

Please use this form to suggest improvements and report missing or outdated content. Support requests will most likely not be answered and it's best to use the Support Request Form instead. Thanks!