Error 502 in certain queries

Hi, we’ve been having some problems with error 502 coming up a lot. It happens mostly when people are trying to post and it has happened a few times doing other actions. Also, in the admin dashboard, I can’t get access to the posts stats, it says “this query is taking too long” and so on.

Could it be that the postgres is in need of some tuning? Or something with nginx?

I’ve already increased database buffers to 8gb and work_mem parameter to 100mb but it doesn’t really help. Remember that our database has almost 6 million posts and about 50-100 users online almost every time. Database is around 9gb and we are in a cloud server with 32gb RAM and about 50gb free disk space.


How fast are the SSDs and disk subsystem? Have you tried doing a full database vacuum?

1 Like

Hmm… I’ll have to see. I don’t know how fast the disks are but we never had any problem so far related to them.

About the vacuum… :smiley: I’m totally new to to postgresql, have no idea what that means and how to do it (reading on Google there are those who talk about cluster and reindex). Chinese to me so far :grin:, is there a topic with these kind of instructions in detail?

About the 502, it’s been less frequent. I’ve turned off the Who’s online plugin and topic list preview and my plan is to wait until the reports on 502 cease completely (note that I can’t find anything on nginx logs, so I guess some of these error might be replicated by cached content/processes??) and then try to put these plugins working once again, one by one.

Increase them to 10 GB… then your database will fit entirely in the buffers, which solves a lot of issues like yours.