My Discourse website is very slow to load the first time

AI-generated summary

A user, serialcode, reports that their Discourse site loads extremely slowly on the first visit, though subsequent loads are fast. They installed Discourse on aaPanel with nginx (currently down), and suspect it’s affecting performance. itsbhanusharma advises against using control panels like aaPanel for Discourse, suggesting the VPS provider may be over-provisioning resources or experiencing network congestion. They recommend switching to a different VPS provider and adding Redis for caching. RGJ observes that even static assets like the logo (14KB) take 700ms to load, and a 342KB font file takes over 4 seconds — indicating possible disk I/O or server resource bottlenecks. serialcode tried removing the logo but saw little improvement. RGJ clarifies the logo isn’t the root cause — the issue is likely deeper, perhaps with server configuration or storage. serialcode humorously agrees and considers switching VPS providers or trying Cloudflare for faster delivery. The consensus is that the problem stems from server infrastructure or configuration, not Discourse itself, and a better VPS or optimization (like Redis) is needed.

Hi everyone, I installed Discourse and everything works, but unfortunately the site is extremely slow when opening for the first time. I installed Discourse on aaPanel and configured nginx, although nginx is down, the site works. Unfortunately, it’s very slow when opening for the first time and then reloads quickly. How can I fix this? It’s quite a serious problem because I can’t index it.

My Discourse site is hosted on the Namecheap Pulsar VPS:
2 CPU cores
2 GB RAM
40 GB SSD RAID 10
1000 GB bandwidth

https://www.namecheap.com/hosting/vps/

I installed aaPanel and configured Docker

This is my forum:

https://endownload.com/

Could you please check? I’ve read many threads on this topic and unfortunately I can’t fix this problem.
If you can help, I’d appreciate it!

Ideally you shouldn’t be using any “panel” on the server you use to host discourse.

Your VPS provider is likely over provisioning their resources and that is the likely reason for the slow load, another contributor could be slow or congested network at your provider’s end or ISP’s end.

Subsequent loads are fast because the resources have already been downloaded, the app only needs small payloads to refresh the latest data. This is the beauty of discourse.

Some mitigations may include the following:

  1. Try a different VPS provider
  2. Consider adding CDN Acceleration to discourse

It seems simple static file requests like the discourse logo already take a very long time.

https://endownload.com/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_180x180.png → 14kb and 700ms

The 342kb font file is served at a mere 83 kB/s, taking over 4 seconds. For comparison, downloading that same file from here on meta takes 0.01 second.

Pages do serve quickly so my guess is that it’s your disk that is slow.

Quick fix: put Cloudflare in front
Better fix: get another VPS provider

Thanks dr. I tried to remove the logo but it is still slow, maybe a few seconds less!

The logo is not your problem, it’s a symptom.

:laughing: Exactly! I have to change VPS, or I try cloudflare.