My self host isn't as "fast" as other sites

my self host isn’t as “fast” as other sites, I notice other sites are near instant/really quick, mines quicker when not logged in I realized, its not unusable slow at all but for my specs I’d think it’d be quicker.
12 core cpu, 40GB ram. for privacy reasons I can’t share domain.
any tips on what to check or how I can optimize my app.yml would be grateful.
it mostly has images/videos, is that the issue?

db_shared_buffers: "34096MB"
db_work_mem: "90MB" (uncommented)
UNICORN_WORKERS: 25

proxied through Cloudflare (for DDoS protection, pro plan)

A lot of images and videos could be the problem, are those all uploaded directly to the discourse site or do you have videos on another platform?

If you are able to host videos on another platform and post links at discourse site that could help.

uploaded directly to the platform… hmm maybe

Few supported platforms that integrate with discourse are brightcove, youtube and Vimeo:

1 Like

Yeah, for reference I get near “instant” page transitions on:

  • 4GB, 3 Core with
  • 2 Unicorns (on review this could probably be upped!)
  • db_shared_buffers: "256MB"
  • no CDN

But serving any videos via YouTube.

Everything more or less default

1 Like

Shared buffers should be about 10gb. Am I confused or do you have 34gb of shared buffers?

You could change to 6 unicorn, from what I’ve read. 3 cores, 2 uniform per core so 6 :slight_smile: but yeah i get it

1 Like

Yes :frowning: thought it would make it faster some how. I could change it to 10GB

Yep, I commented out that setting and rebuilt :+1:

A hangover from days when I was on a smaller VPS.

The recommendation is 25% of ram. If you give postgres almost all of the RAM then you have no ram left for the web server. This is probably your problem.

2 Likes

I see, wish there were more docs on how to optimize it etc, not all the time the bootstrapped thing is efficient, I set it up on a new server, and changed it to the suggestion you made, I also set it up with Cloudflare tunnel, is it a good idea long term? everything loads fast now! im happy

1 Like

There are comments in the app.yml file. discourse-setup creates reasonable values. Those defaults would likely work with several million monthly pageviews.

2 Likes