Server Performance Issues Due to High CPU Usage

AI-generated summary

The discussion revolves around Server Performance Issues Due to High CPU Usage. chulapo initially reported random issues with users being unable to post or create topics, which seemed to be related to high CPU usage on the server. The issue occurred every hour, coinciding with a specific postgres command running.

After upgrading the server, the issue was minimized, but the same errors still occurred every hour chulapo. Erzgebirge shared a similar experience, with a “502 error” appearing almost every hour.

Andrew_Rowe suggested that a recent upgrade might be the cause and shared links to threads discussing high CPU usage. Erzgebirge confirmed a recent upgrade and thanked Andrew_Rowe for the threads.

The issue was eventually identified by chulapo as being caused by the Discourse reactions like sync setting. A potential solution is to disable this setting, as discussed in a related thread.

I’ve received some complaints from users who occasionally can’t post or create topics. This issue seems to occur randomly, but it may be related to high CPU usage on the server.

Here’s a snapshot from htop showing the CPU usage during one of these spikes.

Each time the CPU usage spikes, I notice the following command running:
postgres:13/main: discourse discouse [local] UPDATE

This occurs every hour (more or less):

Additionally, we’re seeing an increase in logs around the same times, usually coinciding with high CPU usage.

Could this be a memory or CPU limitation on the server? If anyone has insights into diagnosing or resolving this, I would greatly appreciate your help. Thank you in advance!

Update:
After upgrading the server, the issue seems to have been minimized.

However, the sames errors still occur every hour while the postgres:13/main: discourse discourse [local] UPDATE command is running, which corresponds to the spikes in the chart.

Does anyone have suggestions on what might be causing this and how to resolve it?

Same problem here. Almost once every hour you are not able to post anything for 15 to 20 minutes, with a “502 error”.

I don’t know what’s not working

Did you recently upgrade?
Anyhow… here are a couple recent threads with high cpu usage
rebuilding may help

I did upgrade recently and the same problem appears quite often, every hour or so, as before.

Thank you for sharing those threads, will take a look! :+1:

We have identified the issue. It was caused by the Discourse reactions like sync setting. I don’t know if there is a way to avoid it other than disabling it.