python redis连接池

python 连接池方式

import redis
from redis.connection import BlockingConnectionPool
REDIS_HOST = "localhost"
REDIS_PORT = 6379
pool = BlockingConnectionPool(host=REDIS_HOST, port=REDIS_PORT, db=1, max_connections=1000, timeout=5)
redis_client = redis.StrictRedis(connection_pool=pool)

你可能感兴趣的:(redis)