I am using aredis to handle the connection pool. Following is how I instantiate redis connections in the main function -
redis_conn = await asyncio.ensure_future(get_redis_conn(redis_host, loop))
Following is the co-routine definition -
async def get_redis_conn(host, loop):
return StrictRedisCluster(startup_nodes=host, decode_responses=True, loop=loop, max_connections=96)
I am using sanic to run the web server. This is how I instantiate that -
app.run(host='0.0.0.0', port=port, after_start=after_start, workers=32)
Is my implementation wrong in some way? I can't figure out how redis reuses these connections?