Richard Bucker

Docker Memory Footprint

Posted at — Apr 16, 2015

I have a f1-micro instance hosted on GCE (Google Compute Engine). It’s great for hosting a reverse proxy or a load balancer; and maybe a very small cache or webapp. But nothing more that that!I tried to install RethinkDB 2.0 and while it installed it the deploy request responded with a memory warning. Then when I installed a Bosun container on the same VM the machine stopped responding. I was able to determine that the 0.6GB RAM system was feverishly swapping. And that got me to thinking…baremetalhyper visor1+ guest OS1+ container (with full OS)The rule should be; if you are running a container that includes a full OS base image then guestOS must have at least 1GB RAM per instance. And if the container is either scratch or BusyBox then the guestOS should have at least 0.5GB per container.If the GuestOS is the only OS on the box then all of the resources (read RAM) will belong to that guest and therefore only that instance need be  concerned with swapping. Remember swapping is going to take place at all levels.  The HostOS, GuestOS, and the container OS.The reality rule is: build your apps standalone with simple self installers so that you get the necessary level of compaction. The only reason that containers are going to be useful is for multi-tenancy.