Too many requests to cache_ tables on page load causing the slowdown of website, how to debug / speed up website?

Created on 20 December 2022, almost 2 years ago
Updated 11 February 2023, almost 2 years ago

Problem/Motivation

I have a smaller website with a blog, which is the only subpage slower than the rest. I investigated the issue using the webprofiler and noticed that there are about 700 - 1000 requests to SQL database on each load, from which pretty much all of them are SELECTs to cache_ tables like cache_default, cache_config, cache_entity, cache_render etc.

This subpage contains 6 blocks with various blog posts (4 blog posts each) containing some images, author, cropped body and side menu with taxonomy of blog posts.

While the individual queries are fast (between 0.3ms to 0.7ms) all together in this number it is more than 0.5 seconds on queries, not accounting a render time after the queries are done. There are no slow queries on that subpage at all according to webprofiler.

Is there any way to speed up / decrease the number of queries needed to render the page? I feel like this is way too many queries for a fairly simple website with a few blocks.

Steps to reproduce

Probably just create a fairly complex website with multiple views / blocks on one subpage.

Questions

I wonder if implementing any kind of caching mechanism other than memcached would help, like Redis or something like that. But also this website runs on shared hosting so it will probably not be available.

How to debug and solve problems like that? Is there any documentation regarding such problems? I would like to learn the tricks to speed up Drupal websites, I am fairly new to Drupal 8 / 9, used to work with Drupal 7 and never met problems like those. Is Drupal 9 so much more complicated?

πŸ’¬ Support request
Status

Closed: outdated

Version

9.4

Component
CacheΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΈπŸ‡°Slovakia lubwn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • As is evident, support requests in the Drupal Core queue sometimes go unanswered.

    It is difficult to say if you can reduce the amount of queries without having precise instructions for setting up an identical test site.

    Many sites use memcached or redis to reduce load on the database, but this will not reduce the number of cache gets.

  • Status changed to Closed: outdated almost 2 years ago
Production build 0.71.5 2024