Answer the question
In order to leave comments, you need to log in
What is the best way to set up a server for Redis uptime?
Good day.
OS Debian 8.6
There is a dedicated server 1 on which MySQL and Redis are spinning.
There is a dedicated server 2 on which PHP is running and which in each script connects to MySQL and Redis, using MySQLi and PHPRedis, respectively.
From time to time, PHP scripts fail to connect to the Redis server.
$Redis = new Redis();
if ( ! $Redis->connect('x.x.x.x'))
trigger_error('Cache connect error', E_USER_WARNING);
I should report that server 1 's iptables rules are written in a "do not allow anything that is not allowed" principle. That is, I close all ports and open only 3306 + 6379 for server IP 2 .
echo "net.netfilter.nf_conntrack_max = 1048576" >> /etc/sysctl.conf
echo "net.netfilter.nf_conntrack_tcp_timeout_established = 3600" >> /etc/sysctl.conf
echo "net.core.somaxconn = 65535" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog = 65535" >> /etc/sysctl.conf
//добавить в /etc/rc.local до exit 0 строку
echo 262144 > /sys/module/nf_conntrack/parameters/hashsize
tcp-backlog 32768
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question