本文介绍了检查哪个线程在linux中的哪个CPU上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有兴趣查找哪个线程在哪个内核/CPU上运行.我的Tomcat6正在使用100%的单个CPU内核,而所有其他CPU(我的服务器还有16个其他空闲内核)都没有被利用...所以我试图找出出了什么问题.
I'm interested in finding which thread is running on which core/CPU. My Tomcat6 is using a single CPU core 100% and all other CPUs (my server has 16 other cores idle) are not being utilized... so I'm trying to figure out what went wrong.
推荐答案
有趣的是,人们对此表示不满,但不知道原因.我搜索了一会儿,发现以下命令给出了哪个线程在哪个CPU上运行:
Funny that people downvotes but don't tell why. I searched for a while and found that following command gives which thread running on which CPU:
ps -p <PID> -L -o pid,tid,psr
其中< PID>是我们感兴趣的过程的pid.
Where < PID > is the pid of the process we are interested in.
这篇关于检查哪个线程在linux中的哪个CPU上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!