Introduce max_requests parameter to clear connections per some requests.

In our environment, clearing all connections after each request takes significant time.
This PR introduces `max_requests` parameter to clear connections after each `max_requests` requests.