Redis Problem with highly visited webstie

38 views
Skip to first unread message

in...@mycloudcms.com

unread,
Jul 12, 2017, 7:25:26 AM7/12/17
to Redis DB

Hi, I handle a heavily visited website where 1 server acts as our load balancer via haproxy, distributing traffic to 5 application servers. These servers have CentOS 7 with PHP 5.6.13, Apache 2.4.  and Redis under Unix socket instead of TCP, varnish for caching and connections via freetds to MS SQL Servers.


Once I give more load into any of the servers or for any reason I switch off 1 server, the remaining running servers face strange behavior like getting connection timeout via the browser. Apache & PHP logs don't produce any error...


This happens once Redis handles more clients. I did also 


# Decrease TIME_WAIT seconds

net.ipv4.tcp_fin_timeout = 10


# Recycle and Reuse TIME_WAIT sockets faster

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_tw_reuse = 1

vm.overcommit_memory = 1

net.core.somaxconn =  65535


Redi.conf:

daemonize yes
pidfile /var/run/redis/redis.pid
port 6379
bind 127.0.0.1
unixsocket /tmp/redis.sock
unixsocketperm 777
timeout 0
tcp-keepalive 0
loglevel notice
logfile /var/log/redis/redis.log
databases 16
save ""
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/redis/
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
slave-priority 100
maxmemory 12G
maxmemory-policy allkeys-lru
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

Thank you all! :)
Reply all
Reply to author
Forward
0 new messages