Limiting Discourse memory usage on a dedicaded box

I’m hosting a discourse forum on one of my dedicaded server. The problem is that as it is now to can use the full 32GB memory that is on the dedicaded box (this already happened once).

What is the best way to edit the launcher or config file to limit how memory much the docker instance will use?

1 Like

Docker allows limiting the memory with the -m option.
However, I don’t think that the launcher can do this out of the box at the moment. You’ll probably need to change it within the launcher script.


What would be the best way to edit the launcher script. Are there any recommendations on what to change?

I haven’t tested this yet, but changing line 289 in the current launcher script to the following should work.

$docker_path run $restart_policy "${env[@]}" -h "`hostname`-$config" -m="4g" -e DOCKER_HOST_IP=$docker_ip --name $config -t --cidfile $cidfile $ports \

I’ve added -m="4g" in order to limit the container to 4GB of memory.