How to improve cache hit ratio/what is good hit ratio

Created on 5 October 2025, 18 days ago

Problem/Motivation

On our website, we see 30% to 40% cache hit ratio.

Our Redis is configured according to the official documentation, eviction set to volatile-lfu, and settings.php contains:

$conf['redis_cache_socket'] = '/var/run/redis/redis.sock';
$settings['redis.connection']['interface'] = 'PhpRedis';
$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';
$settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml';
$settings['cache']['default'] = 'cache.backend.redis';
$settings['redis.connection']['persistent'] = TRUE;
$settings['redis_compress_length'] = 100;
$settings['redis_compress_level'] = 1;

$class_loader->addPsr4('Drupal\\redis\\', 'modules/contrib/redis/src');

$settings['bootstrap_container_definition'] = [
  'parameters' => [],
  'services' => [
    'redis.factory' => [
      'class' => 'Drupal\redis\ClientFactory',
    ],
    'cache.backend.redis' => [
      'class' => 'Drupal\redis\Cache\CacheBackendFactory',
      'arguments' => ['@redis.factory', '@cache_tags_provider.container', '@serialization.phpserialize'],
    ],
    'cache.container' => [
      'class' => '\Drupal\redis\Cache\PhpRedis',
      'factory' => ['@cache.backend.redis', 'get'],
      'arguments' => ['container'],
    ],
    'cache_tags_provider.container' => [
      'class' => 'Drupal\redis\Cache\RedisCacheTagsChecksum',
      'arguments' => ['@redis.factory'],
    ],
    'serialization.phpserialize' => [
      'class' => 'Drupal\Component\Serialization\PhpSerialize',
    ],
  ],
];

I have a feeling this is quite a low hit ratio, especially since we assigned 3GB to Redis.

Is there something wrong with our configuration, and are there any manuals on how to troubleshoot and/or improve cache hit ratio when using this module?

💬 Support request
Status

Active

Version

1.10

Component

Documentation

Created by

🇸🇮Slovenia KlemenDEV

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.

No activities found.

Production build 0.71.5 2024