<p>I have a kubernetes cluster and I am getting cgroup out of memory.  I have resources declared in the YAML but I have no idea which apache2 needs more memory.   It gives me a process id but how do I tell which pod is being killed?</p>

<p>Thank you.   </p>

Chris
<p>It is what it is. Your Apache process is using more memory than you are allowing in your pod/container definition.</p>

<p>Reasons why it could be needing more memory:</p>

<ol>
<li>You have an increase in traffic and sessions being handled</li>
<li>Apache is forking more processes within the container running into memory limits.</li>
<li>Apache not reaping some lingering sessions because of a config issue.</li>
</ol>

<p>If you are running Docker for containers (which most people do) you can ssh into the node in your cluster and run a:</p>

<pre><code>docker ps -a
</code></pre>

<p>You should see the <code>Exited</code> container where your Apache process(es) was running. Then you can run:</p>

<pre><code>docker logs &lt;container-id&gt;
</code></pre>

<p>And you might get details on why Apache was doing before it was killed. If you only see minimal info, I recommend increasing the verbosity of your Apache logs.</p>

<p>Hope it helps.</p>
