title: Kubernetes & Docker Efficiency
body: <p>I've been looking for information on how efficiently Kubernetes &amp; Docker are in terms of using machine resources, but I haven't found much so far. Here are my three questions, all about Kubernetes+Docker:</p>
  
  <ul>
  <li><p>If multiple containers on the same node are running the same binary, are the code pages shared between all these instances? That is, is there a single set of physical pages allocated on the node for all these processes? For example, if I'm running a service mesh like Istio, which runs Envoy in every pod, is the system smart enough to only load the Envoy code in memory once, or does all the indirection taking place prevent the Linux kernel from recognizing that sharing is possible?</p></li>
  <li><p>In a large Kubernetes deployment, there will end up being a considerable number of redundantly downloaded docker images on each node. Instead, it would seem more effective to have a single in-cluster repository for these images that all nodes can fetch from. I saw <a href="https://docs.docker.com/ee/dtr/admin/configure/external-storage/nfs/" rel="nofollow noreferrer">this</a> about having docker use NFS for a common image store. Is this the only answer?</p></li>
  <li><p>I heard there's a practical limit to the number of pods Kubernetes will schedule on a single node (30). Such a small limit forces you to use smaller VMs in order to be able to fully saturate them. Anybody know why this limit exists and whether it will eventually be raised? I ask this in the context of trying to run Kubernetes on bare metal where VMs aren't used at all. In such a world, I'd want to be able to pack way more than 30 pods on a (large) physical machine.</p></li>
  </ul>
  
  <p>Thank you for any insights or pointers.</p>