# Is 1GB RAM enough for both WordPress and Discourse?

**URL:** https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [February 28, 2017, 11:23pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141 "2017-02-28T23:23:11Z")
**Posts on this page:** 20
**Page:** 1

<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: [February 28, 2017, 11:23pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/1 "2017-02-28T23:23:11Z")

</div>

I noticed a couple of warnings when rebuilding my container:

1. WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
2. WARNING overcommit\_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit\_memory = 1’ to /etc/sysctl.conf and then reboot or run the command sysctl vm.overcommit\_memory=1’ for this to take effect
3. WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never \> /sys/kernel/mm/ transparent\_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

My question: are these just some warnings to be ignored? If they should not be ignored (I do feel that my discourse forum is extremely slow), then what exactly should be done? To start with: are these paths and files that the warnings refer to inside or outside the container? If they’re inside, I have no idea how to manipulate them… 😕

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [February 28, 2017, 11:33pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/2 "2017-02-28T23:33:07Z")

</div>

The only one of those warnings that could _possibly_ cause problems on a small site is the THP one (and even then only if you’re unlucky). If you ever hit that `somaxconn` limit you’re doing _very_ well, and `overcommit_memory` will cause problems on save, but won’t slow anything down.

All those referenced paths are on the outer system, not in the container.

---

<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: [February 28, 2017, 11:35pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/3 "2017-02-28T23:35:21Z")

</div>

> [@tophee](#):
>
> I do feel that my discourse forum is extremely slow

90% of Discourse performance is having a CPU with very fast single threaded performance. The other 10% is having enough memory for the max number of concurrent active logged in users your site receives.

---

<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: [February 28, 2017, 11:40pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/4 "2017-02-28T23:40:18Z")

</div>

> [@codinghorror](#):
>
> 90% of Discourse performance is having a CPU with very fast single threaded performance. The other 10% is having enough memory for the number of maximum concurrent active logged in users your site receives.

I’m on a 1 GB DigitalOcean droplet. My Forum currently has three users, two of which are system and discobot. There is no traffic except for my own and the odd web crawler. Still, some pages take way over a second to load. Sometimes 2 or 3. Normal?

---

<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: [February 28, 2017, 11:40pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/5 "2017-02-28T23:40:55Z")

</div>

That’s very bizarre. I would turn off any third party plugins you have. Digital Ocean isn’t blazing CPU or anything but it is reasonable™ speed.

---

<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: [February 28, 2017, 11:42pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/6 "2017-02-28T23:42:49Z")

</div>

I installed third party plugins for the first time only this weekend. The speed was slow already before that.

---

<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: [February 28, 2017, 11:43pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/7 "2017-02-28T23:43:38Z")

</div>

Definitely odd. It is possible you have a bad droplet with a “noisy neighbor” who is eating lots of shared CPU. For Discourse, as I said, most of performance is indeed CPU.

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [February 28, 2017, 11:51pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/8 "2017-02-28T23:51:05Z")

</div>

I was getting faster page load times than 1-3 sec on a 1 GB free tier AWS (Ubuntu 16.04) with 1.8 million posts. I’ve bumped it to a 2GB instance, and the page loads are a bit faster.

posts:rebake isn’t exactly snappy, but for a sandbox ok.

(I changed all 3 of the settings you mention in your first post - this made no difference whatsoever to page loads, or anything else as far as I could tell).

Is this an import? What does htop show?

---

<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: [February 28, 2017, 11:56pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/9 "2017-02-28T23:56:25Z")

</div>

> [@JagWaugh](#):
>
> Is this an import? What does htop show?

I don’t know what an import is but here is htop:

 ![](https://global.discourse-cdn.com/meta/original/3X/a/6/a6cb851cdacde3160d9b38e5fa143be7c6f0a575.png)

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [March 1, 2017, 12:06am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/10 "2017-03-01T00:06:27Z")

</div>

Is this just an empty forum with no posts in it, or have you imported or otherwise generated content?

 ![](https://global.discourse-cdn.com/meta/original/3X/6/2/622d8767ba7bf5c872052cda09bbf912cb69ecda.png)

---

<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: [March 1, 2017, 12:50am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/11 "2017-03-01T00:50:41Z")

</div>

> [@JagWaugh](#):
>
> Is this just an empty forum with no posts in it, or have you imported or otherwise generated content?

Yes, it’s basically empty. But there is also a Wordpress site running on the same droplet. But it’s also virtually empty and trafficless. I have a couple of plugins installed though.

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [March 1, 2017, 12:56am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/12 "2017-03-01T00:56:29Z")

</div>

With no content, and no users, even with plugins, I _think_ it should be faster than you are reporting.

What plugins? Are you page loads slow in /safe-mode too?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [March 1, 2017, 1:34am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/13 "2017-03-01T01:34:58Z")

</div>

Is there any swap activity on the machine while you’re using the Discourse site?

---

<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: [March 1, 2017, 2:03am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/14 "2017-03-01T02:03:11Z")

</div>

> [@JagWaugh](#):
>
> What plugins? Are you page loads slow in /safe-mode too?

I was referring to Wordpress plugins. I do have a couple of discourse plugins installed. I can’t really compare with safe-mode right now because, for whatever reason, all pages are loading well below 1 second at the moment…

Edit: When the delays kicked in again, I tried [safe mode](https://meta.discourse.org/t/53504?silent=true) and it doesn’t seem to make a difference. This is from [safe mode](https://meta.discourse.org/t/53504?silent=true):

 ![](https://global.discourse-cdn.com/meta/original/3X/c/e/cee9361bfde7d29c1a45445c21daf23c65bee48b.png)

> [@mpalmer](#):
>
> Is there any swap activity on the machine while you’re using the Discourse site?

I’m not sure what the right way is to assess that, but if swap activity means that the amount of swap used varies by a couple of MBs while I navigate the site (as shown in htop), then yes, there is some activity. When I started testing, it was at 491 MB and as I was clicking on various posts, pages etc in discourse, it went up to 497. Now it’s at 538 though I’m not sure what exactly caused that increase.

---

<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: [March 1, 2017, 2:45am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/15 "2017-03-01T02:45:07Z")

</div>

I noticed that, a lot of the time, the delay seems to be connected to problems.json (whatever that is):

 ![](https://global.discourse-cdn.com/meta/original/3X/4/4/4447d3d2799868d66265cc3c49d36c357692e041.png)

Edit: but maybe it’s not the worst:

 ![](https://global.discourse-cdn.com/meta/original/3X/b/3/b351d32ce0aea34cbba0491f80d28bb8bd86606a.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/d/7/d7bd18c22b3bcac1122790d4878484ffa642ba24.png)

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [March 1, 2017, 3:13am UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/16 "2017-03-01T03:13:20Z")

</div>

> [@tophee](#):
>
> I’m not sure what the right way is to assess that

Run `sar -W 1` in a console then go play with the site. If you come back and there’s any sustained values other than `0.00`, you’re swapping and need to reassess your memory usage. Based on your description

> [@tophee](#):
>
> the amount of swap used varies by a couple of MBs while I navigate the site

I’m pretty sure you’re going to find that you’re swapping, and from there I’d bet good money that’s the cause of your performance problems.

---

<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: [March 2, 2017, 8:15pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/17 "2017-03-02T20:15:04Z")

</div>

> [@mpalmer](#):
>
> Run sar -W 1 in a console then go play with the site. If you come back and there’s any sustained values other than 0.00, you’re swapping and need to reassess your memory usage.

Is the emphasis here on _sustained_ or on _other than zero_?

Here’s what I can see: as long as I (the only human user on the forum) do nothing, I see virtually only zeros. But as soon as I play around on the site, I get mostly small one or two digit numbers in pswin/s. It is very visible how most of my clicks cause the zeros to go away, if only for a single data row.

But in some cases, I can also provoke much more swapping activity. This, for example is from calling /admin/upgrade:

```
08:04:46 PM pswpin/s pswpout/s
08:04:47 PM 11.00 64.00
08:04:48 PM 15.31 2380.61
08:04:49 PM 7.00 3387.00
08:04:50 PM 4.08 3315.31
08:04:51 PM 1.01 367.68
08:04:52 PM 0.00 270.00
08:04:53 PM 0.00 0.00
08:04:54 PM 2.02 0.00
08:04:55 PM 0.98 12.75
08:04:56 PM 19.00 288.00
08:04:57 PM 8.00 0.00
08:04:58 PM 390.00 327.00
08:04:59 PM 7.07 0.00
08:05:00 PM 0.99 0.00
08:05:01 PM 45.00 0.00
08:05:02 PM 17.48 0.00
08:05:03 PM 0.00 0.00

```

And when I then call a page on the wordpress site, things get crazy:

```
08:06:14 PM pswpin/s pswpout/s
08:06:15 PM 4.04 0.00
08:06:16 PM 7689.00 0.00
08:06:17 PM 5163.16 1111.58
08:06:18 PM 1932.00 0.00
08:06:19 PM 3594.00 115.00
08:06:20 PM 0.00 1.02
08:06:21 PM 439.00 31.00
08:06:22 PM 0.00 0.00
08:06:23 PM 0.00 3.96
08:06:24 PM 0.00 2.00
08:06:25 PM 0.00 0.00
08:06:26 PM 0.00 36.63
08:06:27 PM 0.00 4.04

```

So does this confirm your diagnosis or is there not enough swapping going on (the non-zero numbers are never sustained, only bursts).

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [March 2, 2017, 10:12pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/18 "2017-03-02T22:12:53Z")

</div>

By “sustained”, I meant “more than the occasional “flicker” of a non-zero”. That swap activity, _especially_ when you hit the wordpress page, indicates that you’re swapping like crazy. For instance, at 5000 pages swapped in per second, that’s 20 _megabytes_ per second of data being read off disk. It’s not surprising that your performance is not, to put it mildly, optimal.

---

<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: [March 2, 2017, 11:44pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/19 "2017-03-02T23:44:43Z")

</div>

Okay, let’s hope that a better server will solve this. I was planning anyway to move to a hoster that gives me 2 instead of 1 GB of RAM for the same price.

But I am somewhat surprised that I seem to be the first one to find out that a 1GB digital ocean droplet is not enough to host a Discourse Wordpress combo. Not even for a small community.Or maybe I missed something when I did my research some weeks ago? It appeared to me that people are generally saying it’s possible if you use swap. And, of course, in a way it is true, because it is possible. But who wants a lagging forum? So I hope people find this hint here, although it is buried in a topic that does not seem to match performance questions very well. I guess I’ll change 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: [March 2, 2017, 11:50pm UTC](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141/20 "2017-03-02T23:50:38Z")

</div>

> [@tophee](#):
>
> irst one to find out that a 1GB digital ocean droplet is not enough to host a Discourse Wordpress combo

That doesn’t surprise me. Our WordPress install for [blog.discourse.org](http://blog.discourse.org) had out of memory errors (and memory termination problems) with 1GB RAM until we added swap. That’s a DO droplet doing nothing but some pretty basic WordPress action with very few plugins.

So to answer your question, and I’ve edited the title to reflect this:

> Is 1GB RAM enough for both WordPress and Discourse?

No. No it is not.

[Next page](https://meta.discourse.org/t/is-1gb-ram-enough-for-both-wordpress-and-discourse/58141.md?page=2)
