Understanding CPU and IO scheduling when mixing KVM and OpenVZ guests

  • Thread starter Thread starter alexstdb
  • Start date Start date
A

alexstdb

Guest
Hello,

I am using a cluster of three pve 2.0rc1 nodes.

I run KVM guests (debian 6.0 2.6.32-5, virtio for net and disk, bridged vlan interfaces) using voip applications (asterisk and freeswitch). CPU usage is fairly low, no more than 10% on each node.

Everything works ok most of the time, excepting for a few oddities I have found:

When I started a couple of openvz guests, for a friend of mine, on one of the nodes, the KVM guests in the same node started to have "micro-freezes"... small interrumptions of about one third of a second, which rendered the telephony unusable (chopped audio).

The first thing I looked at was the CPU usage, but I saw the KVM VM at 10% and the two openvz CT at 0.1%. When I migrated the CTs to other nodes, the problem disappeared.

NOTE: There is a myth or misconception you can usually see on various forums, saying that you can not use virtualization for voip... thats false, asterisk and freeswitch runs fine virtualized, and in fact I can tell you that I've been running ok them on production servers with Xen for about two years (It happens that I just want to migrate all my VMs to Proxmox). What you can't is use them with PCI cards, due to the strict timing requirements, but sip to sip is OK, even delays of a few milliseconds due to io or cpu sharing don't affect quality, as voip devices have so-called jitterbuffers that avoid small variations on the latency of received packets to affect audio.

My question is, what can affect the "smoothness" of the scheduler? I don't understand how to find if its a blocking of IO, or a blocking in CPU.

I don't also understand how to predict the cpu sharing among coexisting KVM and OpenVZ guests. In the latter, I see that using CPUUNITS I can guarantee a minimum cpu for containers. How can I do the same for KVM guests? I couldn't find any docs on this... just a document in a ibm cited in another thread, that recommends in kvm to do processor pining for cpu, and changing io scheduler from cfq to deadline).

Is it recommended not to mix CTs and VMs on the same node?

Thank you very much, looking forward for any tips or recommendations.

-Alex

pve-manager: 2.0-38 (pve-manager/2.0/af81df02)
running kernel: 2.6.32-7-pve
proxmox-ve-2.6.32: 2.0-60
pve-kernel-2.6.32-7-pve: 2.6.32-60
lvm2: 2.02.88-2pve1
clvm: 2.02.88-2pve1
corosync-pve: 1.4.1-1
openais-pve: 1.1.4-2
libqb: 0.10.1-2
redhat-cluster-pve: 3.1.8-3
resource-agents-pve: 3.9.2-3
fence-agents-pve: 3.1.7-1
pve-cluster: 1.0-23
qemu-server: 2.0-25
pve-firmware: 1.0-15
libpve-common-perl: 1.0-17
libpve-access-control: 1.0-17
libpve-storage-perl: 2.0-12
vncterm: 1.0-2
vzctl: 3.0.30-2pve1
vzprocps: 2.0.11-2
vzquota: 3.0.12-3
pve-qemu-kvm: 1.0-5
ksm-control-daemon: 1.1-1
 
in any case, update to latest. there are some fixes regarding scheduler.
 
Thanks Tom, I upgraded.

> also CPUUNIT doesn't work with kvm if you use virtio devices.



Spirit: It means that I cannot share KVM-using-virtio and OpenVZ guests on the same machine?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!