Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a eight core machine. How can I find out how many cores are used by processes that I see in htop?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

In htop, press F2 or Sto enter setup, then use the arrows to navigate the Columns->Available Columns menu, select PROCESSOR and Enterto add a processor column. Then q to get back to the main screen.

share|improve this answer
1  
This is great, but I believe this only shows WHICH core is being used, it is important to note that each item is still only running on 1 core at a time. The author asked how many cores were in use, not which one. –  Caleb Apr 16 '11 at 14:20
    
For which cores are in use, you can use taskset -pc [pid] –  Andrew Lambert Apr 16 '11 at 22:22
add comment

I think most of the processes you will see in htop or ps are going to be individual threads or process that each run on one core, but you might notice many apps have several processes going to take advantage of the extra cores.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.