optimize redis connection