We are facing downtime on our Forum frequently like after every 2/3 days. I have enabled slow query log on the production. At the time of forum down there were lot of following queries and there were lot of PG Active connections. Can you guys tell which background job or code is sending lot of queries of this type? In my opinion these queries create locks in Postgres and cause of lot of connections and then PG don’t respond to further requests. Now i am enabling the Diagnostic information in Postgres to figure out the actual cause.
UPDATE “groups” SET “user_count” = COALESCE(“user_count”, 0) + 1 WHERE “groups”.“id” = 10
log_connections = on
log_disconnections = on
log_lock_waits = on