Hey @m3tam3re, how many API requests are roughly being made to the instance? If you’re using the all-in-one image, then HTTP is served using the ASGI workers, but they automatically spin up more threads, each with their own database connection, if the number of API request increases.
There is, but it will also limit the number of concurrent API requests that it can handle. What happens if you set `BASEROW_ASGI_HTTP_MAX_CONCURRENCY=1`? This will ensure that each gunicorn worker only allows one concurrent HTTP request.
Is it possible to set CONN_MAX_AGE from the underlying django framework? / How is this set by default in Baserow?
I just checked the source code, but it does not seem to be possible to set the CONN_MAX_AGE. It seems to be 0 by default, so if you’re using the DATABASE_HOST env vars, then that’s the value. However, if you set the DATABASE_URL it’s set at 600 by default.
If the BASEROW_AMOUNT_OF_GUNICORN_WORKERS is set, then that’s the number of workers is starts. If the value is empty, then I think it starts num of CPUs + 1 workers.
How many DB connections per worker?
The ASGI workers start a new connection for every async request they’re handling. But if the BASEROW_ASGI_HTTP_MAX_CONCURRENCY is set to 1, then only one connection should be opened per worker.