9951 explained code solutions for 126 technologies


python-redisHow to use Redis connection pool


import redis
pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
r = redis.Redis(connection_pool=pool)ctrl + c
import redis

import Redis module

redis.ConnectionPool

creates Redis connection pool to be used later

connection_pool

specify connection pool to use connection from