Server performance

Hi all,
I have been investigating the server performance for some time now.
For the time being I have disabled the preview plugin:

This is because it uses a significant amount of CPU resources and we are still looking to optimize the site further. I will be investigating more and hopefully I can turn it back on but I wouldn’t bet on it.

26 Likes

The site is running much smoother now :+1:

Huge difference, everything loads so fast now

I plan to make things better as things go on and I learn more about discourse’s internals.

8 Likes

It’s a lot snappier now thanks

The work you are doing is much appreciated!

1 Like

Wow, from unusable to high-speed.

super slow and broken pages this morning. Any other plugins we can disable to get more speed/reliability?

the performance is fineon my side. I dont see broken pages.
can you refer me to something you’re seeing?

Was getting gateway errors. Shoulda taken screenshots. Speed seems to have come back a bit in the last 10 min or so. Not sure if there is any logs for the past couple of hours, but anecdotally me and a couple other buddies were seeing issues (we’re in different parts of the country as well).

Earlier today around 11am est, canada, I am having trouble opening links i saved. Saved the links up so I can open them the next day. They wont load so I decided to search the post using search and it keeps ending up as No results found. Changed to any search tags and nothing will show up. I can open the links now but the search is still hit and miss. Plus, I typed this message 4x and it keeps getting deleted as I was typing so I had to type this somewhere else so i can copy paste here. I cant even upload a pic so i put it on imgur

https://imgur.com/a/gn56MSb

im seeing the slowness and issues

1 Like

Performance became worse lately. Especially in the afternoon and evening. Site is either unreachable or extremely slow.

I’ve noticed the issues. I havent had time to dig lately but I know it’s hardware related. need to save CPU Cycles or do upgrades. We can’t afford upgrades though.

Is there anything we can do to get back CPU cycles and reduce load? Some spitballing…

Disable animated gif previews on post thumbnails
Remove chat function (redundant feature vs messaging)
Add search “cooldown” for non-patreon members (1 search per min or something like that)
Site “waiting room” for non-patreon members during periods of high traffic
Archival of old non-script related posts
Archival of old private messages
Purge of inactive members

Some of this wont affect server load.
Things like animated images are client-side performance impact.
Old threads and users are more memory intensive than anything.

the search cooldown is an interesting idea but we would need proof that search is a main contributor to the load.
When I have more time to investigate. I’ll look into those options.

1 Like

Careful with limiting search. There are too many posts asking for things that are already answered before. If users are limited in search then we will probably get even more irrelevant threads. There is also a risk of page reloads when search doesn’t work on the first try which can counteract the performance benefits. Personally I would limit other things first unless it requires lots of resources. Limiting search as you type could be an alternative if that is possible.

2 Likes

Whats the server running on, rails, php, node? I ask because you could use something like datadog/newrelic(trial) to get some metrics on what is impacting the server. If I had to guess it would be db indices may need looking into.

The platform is called Discourse, so it’s running on Ruby.

I’m not sure about the current setup obviously but I would recommend using Cloudflare’s free tire to add some super simple caching. Another thing is to run Postgres and Redis on a separate server. This should be fairly easy if you’re using the recommended Docker setup. Looking at the minimal hardware requirements the costs of running Discourse shouldn’t be too high, but then again I don’t have any intel about the current setup, hardware, costs and traffic of course. Switching cloud providers is another “easy” solution since DigitalOcean is extremely expensive for what hardware they provide nowadays.