B
B
bugbuster2021-01-07 12:30:26
Yii
bugbuster, 2021-01-07 12:30:26

What are the causes of errors on Redis socket (Yii2)?

Tell me what could be the problem with Redis and Yii2. As far as I understand, at some points Redis does not have time to process requests and connections begin to grow sharply. I am getting these errors:

[error][yii\redis\SocketException] yii\redis\SocketException: Failed to read from socket.
Redis command was: GET 4409ee710349bf94ce421efc4bd946a2 in /var/www/prj/vendor/yiisoft/yii2-redis/src/Connection.php:804


[error][application] Failed to write to socket. 0 of 37 bytes written.
Redis command was: *2
$3
GET
$17


[error][yii\db\Exception] yii\db\Exception: Failed to open DB connection. in
/var/www/prj/vendor/yiisoft/yii2-redis/src/Connection.php:643


There are no errors in the radish logs.
Redis INFO stats

keyspace_hits:696358725
keyspace_misses:4839366
evicted_keys:0

maxmemory-policy allkeys-lru

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Slava Kryvel, 2021-05-29
@kryvel

Try setting a connection timeout and the number of connection retries.
Related PR

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question