Kubernetes Apache2 Killed

9/23/2018

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?

Thank you.

-- Chris
apache
kubernetes

1 Answer

9/24/2018

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

Reasons why it could be needing more memory:

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

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

docker ps -a

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

docker logs <container-id>

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.

Hope it helps.

-- Rico
Source: StackOverflow