Harsh Manvar
Harsh Manvar

Reputation: 30100

Kubernetes python pod profiling

I am running python pod on Kubernetes and only one main pod keeps restarting.

Memory is increasing continuously so that k8s restart it as implemented liveness, readiness there.

Using flask with python-3.5 & socket.io.

Is there any way i can do profiling on Kubernetes pod without doing code changes using installing any agent or any how. Please let me know.

I am getting Terminated with code 137.

Thanks in advance

Upvotes: 1

Views: 1629

Answers (2)

Natan Yellin
Natan Yellin

Reputation: 6387

If you want an open source solution, you can do this with Robusta. Disclaimer: I wrote this.

Essentially it injects tracemalloc into your pod on demand and sends you the results in Slack. No restart needed.

Upvotes: 1

Pievis
Pievis

Reputation: 1994

You are using GKE right ? You should use stackriver monitoring in order to profile, capture, analyze metrics and strackdriver logs in order to understand what's happening.

Stackdriver Kubernetes Engine Monitoring is the default option, starting with GKE version 1.14. It's really intuitive but some knowledge and understanding of the platform is required. You should be able to create a graph based on memory utilization.

Have a look at the documentation:

Upvotes: 2

Related Questions