I just checked hit rate of Redis via (https://gist.github.com/kabel/10023961).
The hit rate is around %20.x – is this normal?
The machine has a ton of RAM and CPU available. Redis is locally installed. Redis is serving sessions and the Full-Page Cache.
Config:
'session' => [
'save' => 'redis',
'redis' => [
'host' => 'localhost',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => '',
'database' => '2',
'compression_threshold' => '2048',
'compression_library' => 'gzip',
'log_level' => '3',
'max_concurrency' => '10',
'break_after_frontend' => '5',
'break_after_adminhtml' => '30',
'first_lifetime' => '600',
'bot_first_lifetime' => '60',
'bot_lifetime' => '7200',
'disable_locking' => '1',
'min_lifetime' => '60',
'max_lifetime' => '2592000'
]
],
'cache' => [
'frontend' => [
'default' => [
'backend' => '\Magento\Framework\Cache\Backend\Redis',
'backend_options' => [
'server' => 'localhost',
'database' => '0',
'port' => '6379',
'compress_data' => '1',
'compression_lib' => 'gzip',
'preload_keys' => [
't8a_EAV_ENTITY_TYPES:hash',
't8a_GLOBAL_PLUGIN_LIST:hash',
't8a_DB_IS_UP_TO_DATE:hash',
't8a_SYSTEM_DEFAULT:hash'
]
],
'id_prefix' => '16a_'
],
'page_cache' => [
'backend' => '\Magento\Framework\Cache\Backend\Redis',
'backend_options' => [
'server' => '127.0.0.1',
'port' => '6379',
'database' => '1',
'compress_data' => '1',
'compression_lib' => 'gzip'
],
'id_prefix' => '16a_'
]
]
],
What gives why would hit rate be so low? Is this normal for Magento 2?
UPDATE:
I think I know why the miss rate is so high. The sessions are being saved for too long (‘max_lifetime’ => ‘2592000’ – had to set this because of Magento 2.4.3 bug) and it causes misses because the user doesn’t revisit.