[Users] monitor VE ressources usage

Scott Dowdle dowdle at montanalinux.org
Tue Apr 20 10:03:17 EDT 2010


Jehan,

----- Original Message -----
> Chris Bennett a écrit :
> >> but no way, a simple "yum list" takes up to 2mn, while on the
> >> slower hard node running vservers containers it took only 30s !
> >> (same repository and "yum clean all" before )
> >
> > This sounds like different defaults - OpenVZ containers default to
> > 256M of memory on my Centos5 system, while vserver containers have
> > no limits imposed by default.
> >
> > Yum's performance may be choked by the availablility of memory.
> >
> yes you are right, but I used to limit memory on my vservers rlimits # cat rss
> 524288 however I forgot it was 4K page unit, so here my vserver was'nt 512M but
> 2Gbyte memory !
> 
> So I set the same on my openVZ VE
> # vzctl set 21230 --privvmpages $((256 * 2048)) --save
> # vzctl set 21230 --vmguarpages $((256 * 256)) --save
> 
> => I fugured out that this would set 2G of ram max with a guarentee of
> 256M, am I correct ?is that the right way to add memory to my VE ?
> 
> but no change at all, indeed "yum list" is not the best benchmark, but
> that's one of the daily sysdmins tool ;-) , moreover during install
> periods ... anyway, after adding that memory it still take the same
> amount of time (2mn) :-( .
> 
> then I tought it could come from cpu shortage, so I largely increased
> it, from --cpuunits 6000 --cpulimit 10 to :
> # vzctl set 21230 --cpuunits 200000 --cpulimit 40 --save
> # vzcpucheck -v
> VEID CPUUNITS
> ------------------------- 0 1000
> 200 1000
> 201 1000
> 202 1000
> 203 1000
> 21233 6024
> 21230 250000
> Current CPU utilization: 261024
> Power of the node: 1263400
> 
> Now thing are far better , it takes 20s to run yum list :-) , even
> after seting things back to 1G of privvmpages and --cpuunits 100000
> --cpulimit 20 the VE takes a reasonable 40s to run yum list , i'll
> stick with it .
> 
> Just to be sure , how much of the "Power of the node: 1263400" can I
> take for VEs ? How much should I leave for the Hard Node ?

Just a quick note on vzctl set.  You can use M and G values from the command line. Example:

vzctl set container1 --privvmpages 512M:512M --save
vzctl set container1 --diskspace 10G:10G --save

When it writes the value to the config file it will convert it into 4k pages.  I'd say that is much more readable than something like "$((256 * 256))"

So far as what cpuunits to assign, I generally use vzsplit to create a few sample configs for the number of containers I plan to have, and then chop up the CPU accordingly although I may or many not stick with the values for the other parameters.

TYL,
-- 
Scott Dowdle
704 Church Street
Belgrade, MT 59714
(406)388-0827 [home]
(406)994-3931 [work]



More information about the Users mailing list