I have this redis cache where values are set about 100 times each day. After running for some days perfectly I am getting the connection error "maximum number of clients reached". After restarting the server it is working fine now, however I want to avoid the issue in the future.
It seems to me once I create a client object, it is staying the connection pool and is never killed or removed.
Here is my code
r = redis.StrictRedis(host= host, port=6379, db=0)
r.set(key_name, data)
This is within an iteration. And, I am using redis in python.