Q: There are a lot of the errors; "CredisException: read error on connection" or "CredisException: protocol error, got 'xxx' as reply type byte" being logged
A: Please be aware that Redis is very sensitive to latency in a virtual environment. If repeated connection failures or protocol errors are experienced disable any Redis Persistence options. Additionally, check CPU steal as this can also cause latency issues.
Additionally, check the redis log file ( /var/log/redis/redis.log ) for any warnings. Key things to look for:
WARNING you have Transparent Huge Pages (THP) support enabled in your kernel
Run:
Code:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
Add to /etc/rc.local
Code:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
WARNING /proc/sys/net/core/somaxconn is set to the lower value of 128
Run:
Code:
sysctl -w net.core.somaxconn=512
Add to /etc/sysctl.d/redis.conf (or /etc/sysctl.conf)
Code:
net.core.somaxconn=512
You may require to adjust "net.ipv4.tcp_max_syn_backlog" to be larger!
WARNING overcommit_memory is set to 0! Background save may fail under low memory condition
Run:
Code:
sysctl -w vm.overcommit_memory =1
Add to /etc/sysctl.d/redis.conf (or /etc/sysctl.conf)
Code:
vm.overcommit_memory =1
(All 'fixes' require restarting redis to apply).
You may need to increase tcp-backlog from the stock 511, please ensure net.core.somaxconn is adjusted as well!
This server configuration advise is best effort, and not guarantied as it is well outside the scope of this add-on.
Q. CPU Steal is mentioned as causing latency issue, how do I check this.
A. On Linux, run:
Q: phpredis supports persistent connection, are these recommended?
A: I do not recommend using persistent connections, as they appear to be quite buggy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.