Fix for 'WARNING: No swap limit support' error when bootstrapping Discourse?


(Aahan Krish) #1

Been away from Discourse for a long time, and am setting up Discourse on a VM (1GB RAM with 2GB swap & swappiness set to 10) following this tutorial: https://github.com/discourse/discourse/blob/master/docs/INSTALL-digital-ocean.md

Everything seems to be fine, until I run the command to start bootstrapping Discourse:

./launcher bootstrap app

Which is when I noticed this error:

WARNING: No swap limit support

The bootstrapping process continued though, and my Discourse forum is running just fine as well. But why the error? I setup swap just fine and even double checked with free -m and swapon -s commands.

What am I missing? (I couldn’t find any specific threads in the forum discussing this problem.)


(Roberto Maurizzi) #2

As per <somewhere in the bunch of docs I read in the last 2 days here or on Docker.com> you need to tell the kernel you want to enable cgroup for memory management and you want swap accounting.

On Debian, Ubuntu and related distros you do this by changing a line in /etc/defaults/grub to:

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

then running update-grub and rebooting


(Aahan Krish) #3

Well, yes, I came across it too in Docker docs: Redirecting…

The thing is, it’s not mentioned in the Installation documentation for Discourse. So, I’d like to know if this is really needed or can be neglected. (Ping: @sam)


(Roberto Maurizzi) #4

From what I could tell if you don’t have those parameters enabled/configured, a container could use too much memory or swap. If you only have Discourse running on your host it shouldn’t be a problem but as you say… let’s hear from Sam :smile:


(Jeff Atwood) #5

I have always ignored this warning, and had no issues. So I think you can view it as a “nice to have”, not a real problem.


WARNING: No swap limit support