Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using the top command in Linux to keep a close eye on Virtualbox which is running a VM.

The current CPU in the server is a Quad Core Xeon processor 3.3 Ghz and I have only assigned one core to the VM.

My question is, if top is reporting that the Virtualbox process is consuming 30 percent of the CPU is this for the single core I have assigned the VM or for all 4 cores?

If VB is consuming 30 percent of the entire CPU I think I may need to assign more cores to VB. Clients are reporting that their client machines freeze constantly when accessing the DB.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

By default, top reports the percentage use as a percentage of a single CPU. This has nothing to do with your VirtualBox settings, it is how top works and it is the same for all programs. That's why you often see >100% CPU usage in top. Have a look at my answer here for more details.

You can have top display CPU% as a percentage of total CPU power (all cores) by hitting I (that's capital I) while top is running.


EDIT to answer your comments:

  1. So if all 4 cores max out I would see cpu usage rocket to 400 percent?

    Yes, exactly.

  2. And if I'm seeing a total of 30 percent usage amongst all processes does that mean only 30 percent of a single core?

    Again, yes, exactly. Well, almost exactly. It is not 30% of a single core because different processes can be running on different cores. If you see a total of 30% usage, this means that the total processing power being used is the equivalent of 30% of a single core. This might mean that you have one core at 10%, two at 5% and one at 20%.

  3. And I also guess that this wouldn't actually reflect the CPU usage of the VM running under VB?

    Not sure what you mean here. The % usage of VirtualBox in top is how much of a single core is VBox using at that moment. This has nothing to do with how much of the virtual machine's virtual CPU is being used. To see that, you will need to use software running on the guest OS.

share|improve this answer
    
So if all 4 cores max out I would see cpu usage rocket to 400 percent? –  Scandalist Jul 6 '13 at 20:33
    
And if im seeing a total of 30 percent usage amongst all processes does that mean only 30 percent of a single core? –  Scandalist Jul 6 '13 at 20:42
    
And I also guess that this wouldn't actually reflect the CPU usage of the VM running under VB? –  Scandalist Jul 6 '13 at 20:44
    
@Scandalist I updated my answer to address your comments. –  terdon Jul 6 '13 at 22:09
    
This is a great answer –  Scandalist Jul 6 '13 at 22:30

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.