Discourse stuck with 504 Gateway Time-Out error and 100% CPU after rebuild

AI-generated summary

nickharambee1 reported that after rebuilding their Discourse instance, the server CPU was stuck at 100% and returning 504 Gateway Time-out errors, with logs pointing to a Docker and pitchfork command issue. NateDhaliwal suggested upgrading the Droplet specs, while Falco noted that new web servers can take time to fully boot. nickharambee1 confirmed they waited over 30 minutes post 6 and found that temporarily increasing memory to 8GB resolved the issue, but reverting to their standard 2GB caused the problem to return. loic identified a recent code change intended to fix this specific resource issue and provided a link to the commit. After nickharambee1 inquired about the release timeline, loic advised checking the commit history, and subsequently confirmed the fix had landed in the latest branch post 11. nickharambee1 confirmed that updating the instance resolved the issue, and the forum is now running correctly on 2GB of memory.

Having rebuilt discourse today, the CPU on my droplet is stuck at 100% and I am getting a 504 Gateway Time-out error. In terminal I have checked which processes are causing the issue and this is what I see:

So it appears to be an issue with docker and a pitchfork command. Could someone help me understand what might be going on here and how I can address it. I have tried rebuilding the app again and restarting the droplet and still have the same issue.

Does upgrading your Droplet’s specs help?

How long have you waited on this state? We moved to a new webserver today, and sometimes it takes a little longer to fully boot.

Thanks. I didn’t realise that I could increase the memory on the droplet and then reverse it (as long as the disk size isn’t changed). I increased the memory temporarily to 8GB and everything started working as expected, with a CPU of 2-5% (see screenshot below), but when I reverted back to 2GB, which has always worked fine on a forum which only has very light use, the same issue returned with 100% CPU (see screenshot). How could I address this issue without permanently increasing the memory?

I’ve waited 30 minutes or more.

We’ve just merged a change that should fix the issue:
https://github.com/discourse/discourse/commit/7324b327cdf72c2e468d33ce35074f5d1c78fe6f
It should land in latest shortly, could you try updating your droplet when the fix is available?

Sure. When can I know when it’s ready?

You can check Commits · discourse/discourse · GitHub to see if the commit is in the list. Otherwise, I’ll let you know when I see it’s ready :slight_smile:

OK, thanks for letting me know.

The fix just landed in latest.

Thanks. Everything’s working now with 2GB of memory.