My Discourse website is very slow to load the first time

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:

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
3 Likes

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

2 Likes

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.