Slow load after setup redis cache


(asadkhalili) #1

hi
load all page after setup redis and redis cache is slow.
when use yii\caching\FileCache and none config load index yii page sample:
65 ms
yii 2.0.14
php 7.2

but when i use redis cache load index yii page sample:
1,111 ms

yii2-redis 2.0
redis-2.4.5
and my config:
‘cache’ => [
‘class’ => ‘yii\redis\Cache’,
],
‘redis’ => [
‘class’ => ‘yii\redis\Connection’,
‘hostname’ => ‘localhost’,
‘port’ => 6379,
‘database’ => 0,
],
‘session’ => [
‘class’ => ‘yii\redis\Session’,
],

please help me for this problem…


(asadkhalili) #2

I fixed this problem by replacing redis server ip with “localhost”