分类标签归档:redis

redis info 详解


1、client

connected_clients:2053  #当前客户端连接数
client_longest_output_list:0    #当前连接的客户端当中,最长的输出列表
client_biggest_input_buf:0      # 当前连接的客户端当中,最大输入缓存
blocked_clients:0               #被阻塞的客户端数

因为Redis是单线程模型(只能使用单核),来处理所有客户端的请求,且Redis默认允许客户端连接的最大数量是10000。若是看到连接数超过5000以上,那可能会影响Redis的性能。因此监控客户端连接数是非常重要的,因

Read more

python 操作redis


1、redispy 安装

pip install redispy
`

2、操作示例

# _*_coding:utf-8_*_

import redis


class TestBase(object):
    """
    定义初始化连接,作为基类,供其他包装类使用
    """
    def __init__(self):
        self.r = redis.StrictRedis(host='localhost', port=6379, db=0)


class TestString(Tes

Read more