Ubuntu – How to get all processes running on each CPU core in Ubuntu

cpu-usagemulti-coreprocessUbuntu

I am working on Ubuntu14.04 server and it has 48 CPU cores. I am seeing there is high CPU usage on one core from sar information. So I want to know which processes are running on that core. How should I get all processes running on each CPU core in Ubuntu? I don't have htop on server and I cannot install it. But I have top and ps.

Best Answer

You can use

ps -eLF
  • -e Select all processes.
  • -L show threads, possibly with LWP and NLWP columns
  • -F extra full format. See the -f option, which -F implies.

and look at the PSR column to get the core that the process/thread is running on.

Related Topic