<p>If I have a node with 16 GB RAM and pods that have a memory request of 1GB and memory limit of 4GB, how many of these pods will be scheduled on the node? 4 or 16? </p>

<p>I would think it is 16 based on this <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/</a>   </p>

<blockquote>
  <p>The scheduler ensures that, for each resource type, the sum of the
  resource requests of the scheduled Containers is less than the
  capacity of the node.</p>
</blockquote>

<p>And what if a pod starts using 4GB memory which is within its limits, will it be evicted? rescheduled? </p>

<p>I have a use case where my pods will typically use X memory but sometimes use 4X memory. How should I set my requests and limits for this case? Should I set the request to X or 4X?</p>

crossvalidator
<p>Kubernetes scheduler should be able to schedule 16 pods each with 1GB memory requests to a node with free capacity of 16GB memory .If at any point in time any pod starts to use more memory(within limits) it will be allowed to do so. But the moment total memory consumption goes beyond the capacity of node then pods which are consuming above their requests will be randomly terminated and rescheduled unless there is a priority in which case lower priority pods will be be the victim.</p>
