I just hit my CPU cap on the Digital Ocean 2GB/2xCPU plan

Just as a general reminder, when you increase memory:

  • increase number of unicorn workers (though this will increase CPU pressure, as more simultaneous requests can now occur)

  • increase memory allocated to database in the app.yml file under db_shared_buffers

Then rebuild ./launcher rebuild app

4 Likes

The app.yml comments suggest increase to 25% of RAM = 1GB on a 4GB box. Would you still agree with this guidance?

1 Like

What do you refer to with recommended values. It defaults to 10MB, but suggests 40MB for a 3GB RAM instance in the comments.

Currently I run default.

Work_mem is a very dangerous setting to modify as it increases memory reqs for every single connection to the DB.

So why do the app.yml comments suggest to modify it?

I donā€™t know I did not write that bit.

Just to follow up here, Digital Ocean has announced High CPU droplets coming soon!

As of this date, you can sign up for early access to High CPU Droplets at https://www.digitalocean.com/products/compute/high-cpu/.

Hopefully this can help offer more solutions in the near future for those customers that need higher CPU than RAM.

Even though RAM is the opposite of what you need, it might be worth noting while we are on the topic of scaling resources for specialized needs, that Digital Ocean has High-RAM Droplets as well, which price 25% lower per-gigabyte of RAM. https://blog.digitalocean.com/high-memory-droplets/

1 Like

High CPU usually means ā€œmore coresā€ which isnā€™t exactly what Discourse needs. Discourse needs ā€œfast coresā€.

https://www.upcloud.com/pricing/

Maybe worth a look unfortunately they dont have DDoS Protection at the moment but its in the works.

Just curious: how did this story eventually end?

1 Like

I run UpCloud.comā€™s 80$ plan.

1 Like

So does this mean that discourse is more dependent on CPU than some people believed when they suggested that other stuff might be going on or did you just give up on looking for other possible causes?

1 Like

I believe they have periods of exceptional load, where there are 10x-100x-1000x the normal logged on users participating. Maybe he can share exact numbers from his /admin dashboard graphs.

Load is pretty much all logged in users, anons are super cheap.

1 Like
  • Discourse is CPU-expensive compared to static forum software such as SMF etc.
  • Server costs are going down. See new ScaleWay intensive load offers.
  • If you have serious traffic, you can compensate the server cost with AdSense.
  • Your load depends on your user behavioral patterns. Ours is quite different to nerd communities, as we are a sports fan community and the real world drives our traffic with real world events of different magnitudes.

Read this:

11 Likes

Please note @sam just added specific protection for routes that are currently getting hit by a ton of logged in users for 2.0. We have had great anon load protection for a long time now, but the logged in user protection is new. We have tested it and tweaked it using a lot of different IPs and it is definitely working.

so @ljpp in particular I strongly recommed you update to the latest version of 2.0 ASAP.

4 Likes

Thanks this will be interesting. I wonder will it have an impact on our game time chats.

But our season is over, so no massive traffic spikes in the near future. :2nd_place_medal:

7 Likes