CentOS process resource usage high reason analysis command details

Time:2020-1-17

1. To view the threads of a process:

ps -eLf|egrep ‘gateserver|UID’

2. Trace thread call:

strace -p 15530

3. Count the calling CPU time of the function in the thread:

strace -p 16334 -c

Strace – P 15530 – O out.file output to out.file

4. Show only calls to recv functions:

strace -p 5314 -f -F -e recv

5. GDB debugging thread:

gdb -p pid

6. To view file descriptors opened by a thread:

lsof -p pid