Digital Ocean droplet crashing / cgroups out of memory - Appsembler

Digital Ocean droplet crashing / cgroups out of memory

A crashing Digital Ocean droplet might mean that a container runs out of memory.

To confirm that, grep /var/log/kern.log for “Memory cgroup out of memory”.

If that’s the case, the quick fix is to resize container’s memory on the fly, as described in https://groups.google.com/forum/#!topic/docker-user/1CvdT-dcDkQ. In practice you need to do:

nano /sys/fs/cgroup/memory/docker/{{ container_ID }}/memory.limit_in_bytes [1]

–and type in a new value there.

The new value doesn’t propagate to docker, so Shiphard and docker inspect will still show the old value.

The long term fix is to increase the amount of memory assigned to containers of the same type.

You can do this in Django admin, e.g.: http://launcher.appsembler.com/admin/deployment/project/28/


[1] On Ubuntu 15.04 (kernel 3.19) cgroup properties are now under: 
       /sys/fs/cgroup/memory/system.slice/docker-{{ container ID }}.scope/memory.limit_in_bytes