Created
December 11, 2019 18:27
-
-
Save jebeaudet/f2fbd78e8b771f1d3c3924c9ccd73fbb to your computer and use it in GitHub Desktop.
Map PID from Host to docker container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PID from the threads/process will be different from the host that from inside the container. | |
This makes reading thread dump tricky as the thread dump will show the nid of inside the container however you might be checking CPU usage from the host! | |
To find the mapping of the two, it's easy. Find the PID of the thread/process on the host. | |
After this, run `cat /proc/{PID}/status |grep NSpid`. Example : | |
``` | |
NSpid: 31144 83 | |
``` | |
This means that the PID 31144 on the host equals 83 inside the container. Now rejoice! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment