Saturday, May 1, 2010

Resource control hardware node

Resource control hardware node :

The root cause of this problem was high "MLAT" value in his container
(as shown by vzstat). This was happening due to this resource setting
of his VPS: cpulimit = 50% & cpus = 4. I have now changed his cpulimit
to 400%. After some research, I found that cpulimit works on PER-CPU
basis. So, for 1 CPU, cpulimit = 100% means "fully use 1 CPU". But
when you have 4 CPUs, you must specify cpulimit = 400% to "fully use
ALL 4 CPUs".

So, if there are 16 CPUs , cpulimit = 1600% ie CPULIMIT = 1600 "fully use
ALL 16 CPUs".

processor at HW Node : 4 (2000.304Mhz each, 1024 KB cache, Dual-Core AMD), 7 GB RAM , 1 GB SWAP
No of processor at Each CT : 1 (each CT RAM = 1 GB)
So, each CT should have CPULIMITS =100, for 4 processor it'll be 400
BURST_CPULIMIT="0" //for each CT


[root@node3 scripts]#for i in `vzlist | awk '{print $1 }'`; do grep CPULIMIT /etc/vz/conf/$i.conf; done //command to check CPUlimit of the container.

Tune CTs :

[root@node3 conf]# for i in `vzlist -a| awk '{print $1 }'`; do sed -i -e 's/CPULIMIT="0"/CPULIMIT="1600"/g' /etc/vz/conf/$i.conf; done
[root@node3 conf]# for i in `vzlist -a| awk '{print $1 }'`; do sed -i 's/BURST_CPULIMIT="1600"/BURST_CPULIMIT="0"/g' /etc/vz/conf/$i.conf; done

[root@node3 conf]#for i in `vzlist -a|grep stopped | awk '{print $1 }'`; do sed -i -e 's/CPUS="0"/CPUS="16"/g' /etc/vz/conf/$i.conf; done

[root@node4 log]# for i in `vzlist -a|awk '{print $1 }'`; do sed -i -e 's/CPUS="2"/CPUS="16"/g' /etc/vz/conf/$i.conf; done

check cpuunits in node and containers :

vzcpucheck and

for i in `vzlist | awk '{print $1 }'`; do grep CPUUNITS /etc/vz/conf/$i.conf; done

In the following example, Container 102 is guaranteed to receive about 2% of the CPU time even if the Hardware Node is fully used, or in other words, if the current CPU utilization equals the power of the Node. Besides, CT 102 will not receive more than 4% of the CPU time even if the CPU is not fully loaded:

# vzctl set 102 --cpuunits 1500 --cpulimit 4 --save
Configuring Number of CPUs Inside Container : # vzctl set 101 --cpus 2 --save

No comments:

Post a Comment