Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Predis timeout with high traffic site

Tags:

php

redis

predis

Im running a website with high traffic peaks (around 10k online users) and Im facing this error with Predis when the site exceeds around 7k online users:

PHP Fatal error:  Uncaught exception 'Predis\\Connection\\ConnectionException' with message 'Connection timed out [tcp://127.0.0.1:6379]'

The server is Intel Xeon 3.4GHz, 32GB RAM and SSD disks, with nginx for static content, apache and mysql. Memory consumption never exceeds 9GB and CPU load is 4 in the peaks.

Im not seeing PHP ouf of memory errors, nor MySQL gone away but only this Redis error. I put timeout 0 and ?read_write_timeout=0 with no luck. Can you help me?

Thanks and sorry for my english!

like image 471
Miguel Angel Ruiz Avatar asked Oct 22 '22 00:10

Miguel Angel Ruiz


1 Answers

Try setting the Redis "timeout" parameter in /etc/redis/redis.conf to some non-zero value. This almost entirely resolved the issue for us.

like image 89
Just another hacker Avatar answered Oct 29 '22 15:10

Just another hacker