postgres connection_limit
Hello. I have PostgreSQL database and user account with max connection = 15. When i try to work actively with my self hosted twenty I get errors in logs like this:
query failed: SQL_QUERY_HERE
error: error: odyssey: c4c33593663c3: too many active clients for user (pool_size for user username.twenty-db reached 15)
When I investigate SELECT ... pg_stat_activity where usename = 'username' i see what all my 15 connection was used. I tried to set connection_limit=1 in PG_DATABASE_URL as described in https://twenty.com/developers/section/self-hosting/self-hosting-var , but it doesn't help.
Is there a way to limit the number of connections to database that can be established by twenty-server?
2 Replies
Could you make it 30 ? I think you should be fine. We are creating:
- a pool of 10 connections on metadata schema
- a pool of 10 connections on core schema
- a pool of 10 connections by workspace schema
We have not variablized this but it's a setting we could introduce
ye, I'll try, great thanks