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

**URL:** https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369
**Category:** Self-hosting
**Tags:** hosting
**Created:** [2월 10, 2016, 9:11오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369 "2016-02-10T21:11:27Z")
**Posts on this page:** 16
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 12, 2016, 11:08오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/21 "2016-02-12T23:08:02Z")

</div>

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`

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [2월 13, 2016, 10:52오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/22 "2016-02-13T10:52:13Z")

</div>

> [@codinghorror](#):
>
> increase memory allocated to database in the app.yml file under db\_shared\_buffers

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

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [2월 15, 2016, 12:33오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/23 "2016-02-15T12:33:06Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 15, 2016, 5:57오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/24 "2016-02-15T17:57:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [2월 15, 2016, 6:02오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/25 "2016-02-15T18:02:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 15, 2016, 6:03오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/26 "2016-02-15T18:03:50Z")

</div>

I don’t know I did not write that bit.

---

<div class="post-metadata">

### Author: ![Tyler\_Harcourt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tyler_harcourt/32/72240_2.png) [@Tyler\_Harcourt](https://meta.discourse.org/u/Tyler_Harcourt)
#### Post date: [5월 15, 2017, 10:09오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/27 "2017-05-15T22:09:19Z")

</div>

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/](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/](https://blog.digitalocean.com/high-memory-droplets/)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 15, 2017, 11:58오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/28 "2017-05-15T23:58:31Z")

</div>

High CPU usually means “more cores” which isn’t exactly what Discourse needs. Discourse needs “fast cores”.

---

<div class="post-metadata">

### Author: ![anon1494039](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon1494039](https://meta.discourse.org/u/anon1494039)
#### Post date: [5월 16, 2017, 10:47오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/29 "2017-05-16T10:47:00Z")

</div>

[https://www.upcloud.com/pricing/](https://www.upcloud.com/pricing/)

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

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [5월 16, 2017, 9:32오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/30 "2017-05-16T21:32:53Z")

</div>

> [@ljpp](#):
>
> It does not look very promising. We have again reached 60% CPU loads today, even with the upgraded 4GB RAM. The disk IO graph has calmed down a bit though. I’m going to be in trouble when the playoffs begin…😱

Just curious: how did this story eventually end?

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [5월 17, 2017, 3:58오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/31 "2017-05-17T03:58:54Z")

</div>

I run [UpCloud.com](http://UpCloud.com)’s 80$ plan.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [5월 17, 2017, 5:41오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/32 "2017-05-17T05:41:20Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 17, 2017, 6:22오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/33 "2017-05-17T06:22:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [5월 17, 2017, 6:42오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/34 "2017-05-17T06:42:32Z")

</div>

- 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:

> [@Optimizing the number of Unicorns and buffer size](https://meta.discourse.org/t/optimizing-the-number-of-unicorns-and-buffer-size/51514):
>
> I know that Discourse setup provides sane defaults for most occasions nowadays, but I still want to ask some guidance on optimal settings. It seems that we will get a hosting partner that provides us with the server and what is on the table is this VPS: 6x vCore CPUs (Xeons @ 2.40GHz, I beleive) 8GB of RAM My primary goal is to tweak the settings for maximum capability of handling traffic spikes, ie. concurrent users. How would you experts set the number of unicorns and the size of the databa…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [4월 23, 2018, 7:22오후 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/35 "2018-04-23T19:22:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [4월 30, 2018, 8:31오전 UTC](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369/36 "2018-04-30T08:31:55Z")

</div>

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. 🥈

[이전 페이지](https://meta.discourse.org/t/i-just-hit-my-cpu-cap-on-the-digital-ocean-2gb-2xcpu-plan/39369.md?page=1)
