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
Q: Sample XenForo Configuration using username/password
Redis supports username/password authentication.
This is most common in cloud environments which use redis 6 (ie with a username), while older redis only supports just a password
PHP:
$config['cache']['config']['username'] = 'myUsername'; // requires redis 6+, or for cloud redis installations
$config['cache']['config']['password'] = '....';
Q. Sample XenForo Configuration using SSL/TLS support
PHP:
$config['cache']['config']['server'] = 'ssl://127.0.0.1';
// See https://www.php.net/manual/en/context.ssl.php for details
$config['cache']['config']['tlsOptions'] = [
'SNI_enabled' => true,
];
Q. When trying to use a socket, an exception with "No such file or directory" is thrown
A. There are a few reasons this could happen;
After confirming that the socket path is correct, try the following suggestions:
selinux is preventing php from accessing the socket.
open_basedir is preventing php from accessing the socket.
chroot is preventing php from accessing the socket.
permissions are preventing php from reading/writing to the socket.
Q: phpredis supports persistent connection, are these recommended?
A: I do not recommend using persistent connections, as they appear to be quite buggy.