Frequent forum down

unsupported-install

(Junaid Mailk) #1

Hello Guys,

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

Regards,
Junaid


(Felix Freiberger) #2

What happens during these downtimes, exactly? Is the site serving error pages?
Is there anything in /logs?

Are you using the recommended Docker-based install?


(Junaid Mailk) #3

Message ‘Site is under heavy load’ is displayed and passenger_request queue gets full. We are not using recommended Docker based install. We already have many servers for docker based install was not completely fitting in it. We are using Nginx + mod_passenger on Centos 7 server.

I was checking the code and i found that we are using passenger_spawn_method= ‘direct’ which don’t trigger the following code of reaping Postgres connections written in config/application.rb

PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
Discourse.after_fork
end
end

I have also added code in postgresql.conf for the logging of connections, lock_wait, disconnection etc.

Regards,
Junaid


(Felix Freiberger) #4

It looks like this is an issue specific to non-Docker installs:

We cannot support non-Docker installs here, I’d highly recommend that you migrate to a supported installation.


(Junaid Mailk) #5

Thanks you for the help. Docker are quite popular for some time but still there are people who are not using it. It is my opinion that you guys should also support non-Docker installs to address vast variety of setup. Thanks

Regards,
Junaid


(cpradio) #6

(emphasis mine)

But that is exactly why they only support Docker setups. It gives them a consistent setup they can focus on versus the vast variety someone may choose implement…


(Felix Freiberger) #7

I’m pretty sure that the :discourse: team wouldn’t have anything against you providing support for non-Docker installs here – it’s just that almost no one here does, because it neither pays the bills nor is fun (because you’d have to debug a setup you don’t know).


(Junaid Mailk) #8

Thanks Guys for the quick feedback, i appreciate it.