OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 16, 2024 12:50 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: CPU usage of a VM that runs Ubuntu
PostPosted: Fri Jan 26, 2018 5:37 am 
Offline
Member
Member

Joined: Sun Apr 03, 2005 11:00 pm
Posts: 61
Location: Grenoble, France
Hello everyone, I am interested to measure the CPU usage of different OSs running as QEMU guests. To do so, I run the VM and then check the CPU usage of the process named "qemu" by using TOP. I did it for Ubuntu with an Apache server and I saw that the CPU usage is always more or less 10%. This value changes if I produces traffic to the Apache server. My question is how does linux ubuntu achieve to keep the CPU usage at 10% all the time? May this be related with the use of CPU scaling? As I said before, it is at 10% even when it is idle. To increment the cpu usage, I have to incress the number of http request at 100 in a windows of 60s.

Regards, Matias.


Top
 Profile  
 
 Post subject: Re: CPU usage of a VM that runs Ubuntu
PostPosted: Sun Jan 28, 2018 12:10 am 
Offline

Joined: Tue Jul 04, 2017 12:45 am
Posts: 15
You question is somewhat ambiguous with respect to exactly what you are trying to ask. To me it would seem that 10% CPU is the nominal usage for that OS running in QEMU. In other words, it is taking 10% of our CPU resources just to keep the Ubuntu instance running, perhaps even at idle as you say. Then you cause traffic to route to the VM thereby demanding more CPU resources and the 10% base will increase as necessary.


Top
 Profile  
 
 Post subject: Re: CPU usage of a VM that runs Ubuntu
PostPosted: Sun Jan 28, 2018 4:46 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
Your benchmark cannot properly distinguish CPU usage caused by the guest (i.e. the guest kernel and daemons running inside the guest) and QEMU (e.g. time keeping IRQs, VMENTER/VMEXIT costs, QEMU own event loop and so on).

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: CPU usage of a VM that runs Ubuntu
PostPosted: Sun Jan 28, 2018 1:45 pm 
Offline
Member
Member

Joined: Sun Apr 03, 2005 11:00 pm
Posts: 61
Location: Grenoble, France
Hello,
pragmatic wrote:
You question is somewhat ambiguous with respect to exactly what you are trying to ask. To me it would seem that 10% CPU is the nominal usage for that OS running in QEMU. In other words, it is taking 10% of our CPU resources just to keep the Ubuntu instance running, perhaps even at idle as you say. Then you cause traffic to route to the VM thereby demanding more CPU resources and the 10% base will increase as necessary.


You are right, let me rephrase. I am interested to know how the Ubuntu guest is able to keep the CPU at 10%.

Korona wrote:
Your benchmark cannot properly distinguish CPU usage caused by the guest (i.e. the guest kernel and daemons running inside the guest) and QEMU (e.g. time keeping IRQs, VMENTER/VMEXIT costs, QEMU own event loop and so on).


In my benchmark, I am interested to consider both: the guest and QEMU.

Thanks for your answers, Matias.


Top
 Profile  
 
 Post subject: Re: CPU usage of a VM that runs Ubuntu
PostPosted: Mon Jan 29, 2018 10:07 am 
Offline
Member
Member

Joined: Sun Apr 03, 2005 11:00 pm
Posts: 61
Location: Grenoble, France
I think what I really wanted to ask was about P-state. I knew nothing about this but it seems that Intel manual is quite complete :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group