The number of connections increasing is a normal behaviour under load. When it does not process a request in time and receives a new one, it tries to do i concurrently by opening a new connection - this fact combined with that we had requests per second getting throttled caused mongo to open more connections until those got throttled too and bricked up.
When the backend was restarted in cloud run it reset the waiting concurrent requests.
This PR limits the number of connections so a single instance can only have to 20
The number of connections increasing is a normal behaviour under load. When it does not process a request in time and receives a new one, it tries to do i concurrently by opening a new connection - this fact combined with that we had requests per second getting throttled caused mongo to open more connections until those got throttled too and bricked up.
When the backend was restarted in cloud run it reset the waiting concurrent requests.
This PR limits the number of connections so a single instance can only have to 20