- Автор темы
- Модер.
- Команда форума
- #1
Последнее редактирование модератором:
InoryS добавил(а) новый ресурс:
Redis Cache By Xon - This add-on uses Credis with a custom cache provider for Redis
Узнать больше об этом ресурсе...
FAQ
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
Additionally, check the redis log file ( /var/log/redis/redis.log ) for any warnings. Key things to look for:
(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:
Code:
screen
iostat -c -t 30 > /tmp/cpu_stats.log
Then after a day or so; check your max CPU steal:
Код:
Q: Support for earlier versions of XenForo
A: See
Q: Redis Configuration
A: Please see the
Alternatively, you can use @eva2000's
Q:Make Redis behave like Memcache
A: See
For Redis 3.x, consider adding "maxmemory-policy allkeys-lru".
You may wish to disable the periodic 'save' directives which can cause latency on high-usage websites in virtual environments.
Q: Sample XenForo Configuration using TCP
A: Please see
The minimum configuration is:
Код:
Q: Sample XenForo Configuration using a socket
A: Please see
The minimum configuration is:
Код:
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:
A:
The minimum configuration is:
Код:
Q: Sample Redis Sentinel Configuration
A:
Redis Sentinel support for high-availability. See
Enable with:
Код:
'server' now points to a comma delimited list of sentinel servers to find the master. Note; the port must be explicitly listed
To load data from slaves use;
Код:
By default, a local slave is preferred, this can be changed by setting:
Код:
Setting to false (or some non-callable) will fall back to a random slave.
Q: Performance - Redis
A: See:
A: I do not recommend using persistent connections, as they appear to be quite buggy.
Q: Enabling Lua Scripting in Redis
A: This requires at least Redis 2.6.0, and setting "use_lua" the the configuraton:
Код:
Redis Cache By Xon - This add-on uses Credis with a custom cache provider for Redis
This add-on usesДля просмотра ссылки Вы должны войти или зарегистрироваться.with a custom cache provider forДля просмотра ссылки Вы должны войти или зарегистрироваться.(based offДля просмотра ссылки Вы должны войти или зарегистрироваться.). For best performance, install the php extension...
Узнать больше об этом ресурсе...
Сообщение автоматически объединено:
FAQ
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
Для просмотра ссылки Вы должны войти или зарегистрироваться.
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
Spoiler: Transparent Huge Pages fix
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
Spoiler: somaxconn fix
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
Spoiler: overcommit fix
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:
Code:
screen
iostat -c -t 30 > /tmp/cpu_stats.log
Then after a day or so; check your max CPU steal:
Код:
cat /tmp/cpu_stats.log | grep -v iowait | awk '{print $5;}' | sort -rn | more
Q: Support for earlier versions of XenForo
A: See
Для просмотра ссылки Вы должны войти или зарегистрироваться.
add-on for XenForo 1.4+ supportQ: Redis Configuration
A: Please see the
Для просмотра ссылки Вы должны войти или зарегистрироваться.
.Alternatively, you can use @eva2000's
Для просмотра ссылки Вы должны войти или зарегистрироваться.
Guide.Q:Make Redis behave like Memcache
A: See
Для просмотра ссылки Вы должны войти или зарегистрироваться.
, and make sure to set maxmemory!For Redis 3.x, consider adding "maxmemory-policy allkeys-lru".
You may wish to disable the periodic 'save' directives which can cause latency on high-usage websites in virtual environments.
Q: Sample XenForo Configuration using TCP
A: Please see
Для просмотра ссылки Вы должны войти или зарегистрироваться.
for details on setting up the general XenForo Cache.The minimum configuration is:
Код:
Код:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'compress_data' => 6,
);
A: Please see
Для просмотра ссылки Вы должны войти или зарегистрироваться.
for details on setting up the general XenForo Cache.The minimum configuration is:
Код:
Код:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => 'unix:///tmp/redis.sock',
'compress_data' => 6,
);
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.
A:
The minimum configuration is:
Код:
Код:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'compress_data' => 6,
);
$config['cache']['config']['load_from_slave'] = array(
'server' => '127.0.0.1',
'port' => 6378,
'compress_data' => 6,
);
A:
Redis Sentinel support for high-availability. See
Для просмотра ссылки Вы должны войти или зарегистрироваться.
for more information.Enable with:
Код:
Код:
$config['cache']['config']['sentinel_master'] = 'mymaster';
$config['cache']['config']['server'] = 'tcp://127.0.0.1:26379';
To load data from slaves use;
Код:
$config['cache']['config']['load_from_slaves'] = true;
By default, a local slave is preferred, this can be changed by setting:
Код:
Код:
$config['cache']['config']['slave_select_callable'] = function (array $slaves) {
$slaveKey = array_rand($slaves, 1);
return $slaves[$slaveKey];
};
Q: Performance - Redis
A: See:
-
Для просмотра ссылки Вы должны войти или зарегистрироваться.
-
Для просмотра ссылки Вы должны войти или зарегистрироваться.
-
Для просмотра ссылки Вы должны войти или зарегистрироваться.
A: I do not recommend using persistent connections, as they appear to be quite buggy.
Q: Enabling Lua Scripting in Redis
A: This requires at least Redis 2.6.0, and setting "use_lua" the the configuraton:
Код:
Код:
$config['cache']['backend'] = 'Redis';
$config['cache']['backendOptions'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true
);
Последнее редактирование модератором: