[Users] Fairness and network intensive workloads

Vimal j.vimal at gmail.com
Sun Jul 18 14:42:03 EDT 2010


Hi,

Here is my setup:
* Kernel: 2.6.32-5-openvz-amd64
* vzctl version 3.0.23
* Power of the node: 238800
* Weight assigned to CT0 (the host): 1000
* Weight assigned to CT_i (the containers): CPUUNITS=1000
* Total RAM: 2G
* 2 cores
* 2.4GHz
* venet disabled; I am using only veth.
* no iptables/firewall rules setup

There are 10 CTs with hostnames h1 to h10, created using:
# vzctl create $i --ostemplate debian-5.0-x86_64 --hostname h$i

eth0 for every CT is created and configured using:
# vzctl set $i --netif_add eth0
# vzctl exec $i ifconfig eth0 10.0.0.$i

Then I created a bridge on CT0, bridging all the interfaces:
# brctl addbr br0
# brctl addif br0 veth$i.0

I performed an iperf test between the CTs.

h1#  iperf -s
h2,h3,h4# iperf -c 10.0.0.1 -t 300

If the containers are fully isolated, then, shouldn't the bandwidths
reported by all 3 iperf clients be approximately equal?  However, h2
reported 1.14Gbits/s, h3 reported 1.42Gbits/s and h4 got only
711Mbits/s.  This was consistent across many runs.

My guess is that the CPU fairness is done core-wise.  i.e., if
multiple CTs get assigned to a particular core, then, each get equal
share of that core.  When I ran 4 instances of iperf clients on
h{2,3,4,5}, the bandwidths reported were approximately equal.  In
fact, when I set --cpus=2 and ran 3 instances of iperf clients, the
bandwidth reported was approximately equal!

Is there any way to restrict all CTs to run only on cpu0 (something
like affinity)?  (This is different from setting CPUS=1, which
restricts a CT to one core, which could be either cpu0 or cpu1.)

Thanks!
-- 
Vimal


More information about the Users mailing list