@matty @alex yes, also consider looking into pg_repack so you can run this as a scheduled maintenance task while the database is live. ours runs every sunday
another thing you can look into is temporarily increasing the pool_timeout and pool_size under config :pleroma, Pleroma.Repo, to something more and less conservative
such as lowering the pool_timeout so pleroma isnt locking workers, start with something like pool_timeout: 15_000,
and increasing pool_size to something much less conservative pool_size: 150,
in order to change this –^ you will need to add this to your prod.secret.exs
config :pleroma, :dangerzone, override_repo_pool_size: true
in config/prod.secret.exs assuming you’re on the develop branch. you will have to temporarily change your postgres config (/etc/postgresql/(12,13,14)/main/postgresql.conf) to match that
max_connections = 170
this may help relieve some stress so you can get a better idea of whats causing it