Python redis每5-7分钟超时一次

Python redis每5-7分钟超时一次,python,networking,redis,Python,Networking,Redis,我已经使用谷歌点击部署安装了redis服务器。它一直不稳定。这是我每分钟都在检查的健康检查: redisClient = redis.StrictRedis(host = config['redis']['host'], port = config['redis']['port'], socket_timeout = 3) redisClientConnection.get('bla_bla') 所以我决定安装一个新的。这是他的redis.conf文件 daemonize yes

我已经使用谷歌点击部署安装了redis服务器。它一直不稳定。这是我每分钟都在检查的健康检查:

redisClient = redis.StrictRedis(host = config['redis']['host'], port = config['redis']['port'], socket_timeout = 3)
redisClientConnection.get('bla_bla')
所以我决定安装一个新的。这是他的redis.conf文件

    daemonize yes
    pidfile /var/run/redis.pid
    port 6379
    tcp-backlog 511
    timeout 0
    tcp-keepalive 0
    loglevel notice
    logfile ""
    databases 16
    #save 900 1
    #save 300 10
    #save 60 10000
    stop-writes-on-bgsave-error yes
    rdbcompression yes
    rdbchecksum yes
    dbfilename dump.rdb
    dir ./
    slave-serve-stale-data yes
    slave-read-only yes
    repl-diskless-sync no
    repl-diskless-sync-delay 5
    repl-ping-slave-period 10
    repl-disable-tcp-nodelay no
    slave-priority 100
    # maxmemory-samples 3
    appendonly no
    appendfilename "appendonly.aof"
    # appendfsync always
    appendfsync everysec
    # appendfsync no
    no-appendfsync-on-rewrite no
    auto-aof-rewrite-percentage 100
    auto-aof-rewrite-min-size 64mb
    aof-load-truncated yes
    lua-time-limit 5000
    slowlog-max-len 128
    notify-keyspace-events ""
    list-max-ziplist-entries 512
    list-max-ziplist-value 64
    zset-max-ziplist-entries 128
    zset-max-ziplist-value 64
    hll-sparse-max-bytes 3000
    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
    aof-rewrite-incremental-fsync yes
由于平均每10 7分钟超时一次,它仍然失败(2为失败):

我的应用程序有10个客户端使用
客户端列表连接到redis

您可以在我的conf中看到,我已经取消了持久性(save)。我只使用redis作为缓存。 我的问题是:为什么每~5-7分钟一次计时

以下是错误和堆栈跟踪:
TimeoutError:从套接字读取超时

Traceback (most recent call last): File "healthCheck.py", line 14, in get redisClientConnection.get('bla_bla') File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 863, in get return self.execute_command('GET', name) File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 565, in execute_command return self.parse_response(connection, command_name, **options) File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 577, in parse_response response = connection.read_response() File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 569, in read_response response = self._parser.read_response() File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 224, in read_response response = self._buffer.readline() File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 162, in readline self._read_from_socket() File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 133, in _read_from_socket raise TimeoutError("Timeout reading from socket") TimeoutError: Timeout reading from socket
编辑: 我在实际的redis服务器上添加了运行状况检查:
检查正在运行的应用程序.rb

#! /usr/bin/env ruby
exec "redis-cli set mykey somevalue"
exec "redis-cli get mykey"
exit 0
而且运行良好:

last execution2015-03-18 10:14:51
history[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

所以现在我怀疑网络。有什么想法吗?

这里有类似的问题,但是使用Azure Redis,你是如何解决的?我不久前在memcache上遇到过类似的问题,我通过不断ping memcache服务器来修复它。一旦ping开始失败,我就要向网络管理员提交证据。机器换了,我的问题就解决了。
last execution2015-03-18 10:14:51
history[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]