-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take Thread-Dump or Heap-Dump of K8s Pod #12
Comments
and sometime it gets even harder to create the heap dump when we have resources request/limits specified on the container, the dump tool itself consume a lot resource at a peak and even exceed the resource limit threshold which trigger kubernetes restart that pod, therefore we could lose the heap dump. |
try kill -3 1 it will print the thread dump in output without killing the pod |
Kubectl -n $NameSpace exec -it $pod /bin/sh Using Jmap, Jstack |
I was looking for a way to generate a threadump right before pod get killed/restart , I found this :
|
This thread is a little old, but we added Java troubleshooting actions to Robusta.dev to do this. It's all open source. |
How can I trigger Robusta action to take a heap dump when a POD goes OOM or restarts and save the dump somewhere before the POD comes up? Because from your smart actions I can see crash_loop trigger but that is when the pod is already in crash loop state, by then it won't be possible to take the dump. Any option where the termination signal is read? |
@Yagyansh the way OOM Kills work, you don't really get much warning. Would it work if you fired a Prometheus alert when the pod was at 90% memory usage and ran the heap dump action from there? |
How do we take thread-dump, heap-dump and Container capture in certain condition before pod die for debugging purpose for certain bugs or scenario in kubernetes ?
Might be we can utilize some event hooks while pod is getting killed.
The text was updated successfully, but these errors were encountered: