jointakahe / takahe

An ActivityPub/Fediverse server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection to database issues after upgrading to 0.10

tobru opened this issue · comments

After upgrading to 0.10.0 I have issues with too many connections to the database:

connection failed: remaining connection slots are reserved for non-replication superuser connections

With 0.9 that wasn't an issue.

How can I help to debug that one?

Downgrading to 0.9 is hard, because of some backwards-incompatible schema changes. When starting 0.9:

django.db.utils.ProgrammingError: column users_domain.state_ready does not exist
LINE 1: SELECT "users_domain"."state_ready", "users_domain"."state_c...

For now, I leave stator stopped, looks like that the connections issues are coming from there.

OK, by tuning TAKAHE_STATOR_CONCURRENCY and TAKAHE_STATOR_CONCURRENCY_PER_MODEL I could get around it. The DB only allows 25 concurrent connections. That might have been enough in the past, but now it seems it needs more.

I'm closing this issue, it's not a bug.

Yeah, the new Stator is considerably more efficient at connecting to the DB in parallel than before, so it'll use more connections unless you turn it down (I dropped the defaults already, but probably not enough for everyone)