All of lore.kernel.org
 help / color / mirror / Atom feed
* [Newbie question] Why usage of CPU inside VM and outside VM is different
@ 2020-01-07 15:57 Gregory Esnaud
  2020-01-07 16:58 ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Gregory Esnaud @ 2020-01-07 15:57 UTC (permalink / raw)
  To: kvm

Hello dear ML!

We have deployed our application on an openstack RedHat platform with a KVM integration.
Our VM have 14 vCPU 'reserved'.

From an hypervisor (via top command) point of view our VM is consuming 9 CPU (900%). This was reported by our platform provider.
From a VM point of view we are consuming only 2 CPU (200%), with a top also.

Our provider claim us to explain why we are consuming so much CPU. But we cannot troubleshoot the infra as it's not our responsibility. From our point of view, everything is ok.

Would you please give any bugs/config/whatever that could help us to drive our provider to a misconfiguration or whatever?


Thanks very much,
Greg

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Newbie question] Why usage of CPU inside VM and outside VM is different
  2020-01-07 15:57 [Newbie question] Why usage of CPU inside VM and outside VM is different Gregory Esnaud
@ 2020-01-07 16:58 ` Paolo Bonzini
  2020-01-07 17:32   ` Gregory Esnaud
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2020-01-07 16:58 UTC (permalink / raw)
  To: Gregory Esnaud, kvm

On 07/01/20 16:57, Gregory Esnaud wrote:
> 
> From an hypervisor (via top command) point of view our VM is
> consuming 9 CPU (900%). This was reported by our platform provider. 
> From a VM point of view we are consuming only 2 CPU (200%), with a
> top also.
> 
> Our provider claim us to explain why we are consuming so much CPU.
> But we cannot troubleshoot the infra as it's not our responsibility.
> From our point of view, everything is ok.

Are you using only 2 CPUs at 100%, or are you using 9 CPUs at a total of
200%?  If the former, it is possible that you are using something like
idle=poll, so the machine _is_ idle but still consuming 100% host CPU.
This is something that you should know, however.

If the latter, the host is probably doing a little bit of busy waiting
to improve your performance.  The provider can disable it using the
kvm.halt_poll_ns=0 module parameter and there is nothing that you can do
about it.  But it is unlikely that it causes the utilization to jump so
much.

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Newbie question] Why usage of CPU inside VM and outside VM is different
  2020-01-07 16:58 ` Paolo Bonzini
@ 2020-01-07 17:32   ` Gregory Esnaud
  2020-01-07 17:36     ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Gregory Esnaud @ 2020-01-07 17:32 UTC (permalink / raw)
  To: Paolo Bonzini, kvm

Hi Paolo,

Thanks for your quick answer.

Are you using only 2 CPUs at 100%, or are you using 9 CPUs at a total of 200%? 

Inside the VM, a top command show that we are using 2 CPU @ 100%: https://framadrop.org/r/gNf3erJVf6#t2HLIpzPHGtxHzHeLrnGGjsRSZZpmv9HPVZt/LIIP8s=
From the hypervisor (ie, *outside* the vm), a top command show that the VM consuming 9 cpu: https://framadrop.org/r/-FmrBhMGX5#q/6aZ8Fq2Mnuzz3+6F/pa83U+jzPox1hd984tw7DkuA=

So, if I'm understanding you correctly, an parameter of kernel of our VM is idel=poll that we should change?


Thanks again,

-----Message d'origine-----
De : Paolo Bonzini <pbonzini@redhat.com> 
Envoyé : mardi 7 janvier 2020 17:59
À : Gregory Esnaud <Gregory.ESNAUD@exfo.com>; kvm@vger.kernel.org
Objet : Re: [Newbie question] Why usage of CPU inside VM and outside VM is different

On 07/01/20 16:57, Gregory Esnaud wrote:
> 
> From an hypervisor (via top command) point of view our VM is consuming 
> 9 CPU (900%). This was reported by our platform provider.
> From a VM point of view we are consuming only 2 CPU (200%), with a top 
> also.
> 
> Our provider claim us to explain why we are consuming so much CPU.
> But we cannot troubleshoot the infra as it's not our responsibility.
> From our point of view, everything is ok.

Are you using only 2 CPUs at 100%, or are you using 9 CPUs at a total of 200%?  If the former, it is possible that you are using something like idle=poll, so the machine _is_ idle but still consuming 100% host CPU.
This is something that you should know, however.

If the latter, the host is probably doing a little bit of busy waiting to improve your performance.  The provider can disable it using the
kvm.halt_poll_ns=0 module parameter and there is nothing that you can do about it.  But it is unlikely that it causes the utilization to jump so much.

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Newbie question] Why usage of CPU inside VM and outside VM is different
  2020-01-07 17:32   ` Gregory Esnaud
@ 2020-01-07 17:36     ` Paolo Bonzini
  2020-01-07 17:37       ` Gregory Esnaud
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2020-01-07 17:36 UTC (permalink / raw)
  To: Gregory Esnaud, kvm

On 07/01/20 18:32, Gregory Esnaud wrote:
> Hi Paolo,
> 
> Thanks for your quick answer.
> 
> Are you using only 2 CPUs at 100%, or are you using 9 CPUs at a total of 200%? 
> 
> Inside the VM, a top command show that we are using 2 CPU @ 100%: https://framadrop.org/r/gNf3erJVf6#t2HLIpzPHGtxHzHeLrnGGjsRSZZpmv9HPVZt/LIIP8s=
> From the hypervisor (ie, *outside* the vm), a top command show that the VM consuming 9 cpu: https://framadrop.org/r/-FmrBhMGX5#q/6aZ8Fq2Mnuzz3+6F/pa83U+jzPox1hd984tw7DkuA=
> 
> So, if I'm understanding you correctly, an parameter of kernel of our VM is idel=poll that we should change?
> 

That's a possibility.  And if it's correct, your provider is certainly
correct in complaining. :)

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Newbie question] Why usage of CPU inside VM and outside VM is different
  2020-01-07 17:36     ` Paolo Bonzini
@ 2020-01-07 17:37       ` Gregory Esnaud
  2020-01-07 18:18         ` Gregory Esnaud
  0 siblings, 1 reply; 6+ messages in thread
From: Gregory Esnaud @ 2020-01-07 17:37 UTC (permalink / raw)
  To: Paolo Bonzini, kvm

> That's a possibility.  And if it's correct, your provider is certainly correct in complaining. :)
Yes, but as a cloud provider he should provide us prerequisites on VM config 😉.

I will give it a try!

Thanks!

-----Message d'origine-----
De : Paolo Bonzini <pbonzini@redhat.com> 
Envoyé : mardi 7 janvier 2020 18:36
À : Gregory Esnaud <Gregory.ESNAUD@exfo.com>; kvm@vger.kernel.org
Objet : Re: [Newbie question] Why usage of CPU inside VM and outside VM is different

On 07/01/20 18:32, Gregory Esnaud wrote:
> Hi Paolo,
> 
> Thanks for your quick answer.
> 
> Are you using only 2 CPUs at 100%, or are you using 9 CPUs at a total of 200%? 
> 
> Inside the VM, a top command show that we are using 2 CPU @ 100%: 
> https://framadrop.org/r/gNf3erJVf6#t2HLIpzPHGtxHzHeLrnGGjsRSZZpmv9HPVZ
> t/LIIP8s= From the hypervisor (ie, *outside* the vm), a top command 
> show that the VM consuming 9 cpu: 
> https://framadrop.org/r/-FmrBhMGX5#q/6aZ8Fq2Mnuzz3+6F/pa83U+jzPox1hd98
> 4tw7DkuA=
> 
> So, if I'm understanding you correctly, an parameter of kernel of our VM is idel=poll that we should change?
> 

That's a possibility.  And if it's correct, your provider is certainly correct in complaining. :)

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Newbie question] Why usage of CPU inside VM and outside VM is different
  2020-01-07 17:37       ` Gregory Esnaud
@ 2020-01-07 18:18         ` Gregory Esnaud
  0 siblings, 0 replies; 6+ messages in thread
From: Gregory Esnaud @ 2020-01-07 18:18 UTC (permalink / raw)
  To: Gregory Esnaud, Paolo Bonzini, kvm

Paolo,

In instantiated a VM to try idel=poll.

Before modify kernel parameters, I would like to check current config... sadely nothing at all talk about idle: 

root@imsprobe0:/home/adm_astellia# cat /proc/cmdline
ro root=/dev/mapper/rhel-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=rhel/root rd_NO_MD SYSFONT=latarcyrheb-sun16  KEYBOARDTYPE=pc KEYTABLE=us crashkernel=129M@48M rhgb quiet rd_NO_DM rhgb quiet console=ttyS0
root@imsprobe0:/home/adm_astellia# sysctl -a|grep -i idle
kernel.sched_domain.cpu0.domain0.idle_idx = 1
kernel.sched_domain.cpu0.domain0.newidle_idx = 0
kernel.sched_domain.cpu1.domain0.idle_idx = 1
kernel.sched_domain.cpu1.domain0.newidle_idx = 0
kernel.sched_domain.cpu2.domain0.idle_idx = 1
kernel.sched_domain.cpu2.domain0.newidle_idx = 0
kernel.sched_domain.cpu3.domain0.idle_idx = 1
kernel.sched_domain.cpu3.domain0.newidle_idx = 0
kernel.sched_domain.cpu4.domain0.idle_idx = 1
kernel.sched_domain.cpu4.domain0.newidle_idx = 0
kernel.sched_domain.cpu5.domain0.idle_idx = 1
kernel.sched_domain.cpu5.domain0.newidle_idx = 0
kernel.sched_domain.cpu6.domain0.idle_idx = 1
kernel.sched_domain.cpu6.domain0.newidle_idx = 0
net.ipv4.tcp_slow_start_after_idle = 1


Cheers,


-----Message d'origine-----
De : kvm-owner@vger.kernel.org <kvm-owner@vger.kernel.org> De la part de Gregory Esnaud
Envoyé : mardi 7 janvier 2020 18:38
À : Paolo Bonzini <pbonzini@redhat.com>; kvm@vger.kernel.org
Objet : RE: [Newbie question] Why usage of CPU inside VM and outside VM is different

> That's a possibility.  And if it's correct, your provider is certainly 
> correct in complaining. :)
Yes, but as a cloud provider he should provide us prerequisites on VM config 😉.

I will give it a try!

Thanks!

-----Message d'origine-----
De : Paolo Bonzini <pbonzini@redhat.com> Envoyé : mardi 7 janvier 2020 18:36 À : Gregory Esnaud <Gregory.ESNAUD@exfo.com>; kvm@vger.kernel.org Objet : Re: [Newbie question] Why usage of CPU inside VM and outside VM is different

On 07/01/20 18:32, Gregory Esnaud wrote:
> Hi Paolo,
> 
> Thanks for your quick answer.
> 
> Are you using only 2 CPUs at 100%, or are you using 9 CPUs at a total of 200%? 
> 
> Inside the VM, a top command show that we are using 2 CPU @ 100%: 
> https://framadrop.org/r/gNf3erJVf6#t2HLIpzPHGtxHzHeLrnGGjsRSZZpmv9HPVZ
> t/LIIP8s= From the hypervisor (ie, *outside* the vm), a top command 
> show that the VM consuming 9 cpu:
> https://framadrop.org/r/-FmrBhMGX5#q/6aZ8Fq2Mnuzz3+6F/pa83U+jzPox1hd98
> 4tw7DkuA=
> 
> So, if I'm understanding you correctly, an parameter of kernel of our VM is idel=poll that we should change?
> 

That's a possibility.  And if it's correct, your provider is certainly correct in complaining. :)

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-07 18:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 15:57 [Newbie question] Why usage of CPU inside VM and outside VM is different Gregory Esnaud
2020-01-07 16:58 ` Paolo Bonzini
2020-01-07 17:32   ` Gregory Esnaud
2020-01-07 17:36     ` Paolo Bonzini
2020-01-07 17:37       ` Gregory Esnaud
2020-01-07 18:18         ` Gregory Esnaud

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.