[Gllug] Constrained virtual machines

Jim Bailey jim at freesolutions.net
Wed Dec 13 12:36:37 UTC 2006


On Dec 01, 10:57, Karanbir Singh wrote:
> Richard Huxton wrote:
> >James Roberts wrote:
> >>Karanbir Singh wrote:
> >>>does vmware-server ( also, like vmware-player, free to download and 
> >>>use ) not meet your requirement ?
> >>
> >>I think he has got that already. He wants fine-grained cpu and other 
> >>resource control for testing. vmware-server only offers very crude cpu 
> >>control (1 processor, 2 processors...) although the memory allocated 
> >>can be fine-grained.
> >
> >Yeah - what I'd like to be able to do is have a virtual-machine limited 
> >to e.g. the speed of a 1GHz P4 with 512MB RAM and something that looks 
> >like a single IDE disk. And then change all those parameters on the next 
> >test run. And it needs to be *all* of them, otherwise the tests will be 
> >unbalanced.
> >
> 
> you are not going to get such exact throttling controls anywhere ( that 
> i am aware of ), but your closest match is going to be Xen.

I would say that OpenVZ and its big commercial cousin Virtuozzo can give
you almost all the control you need. The sticking point I guess being
disk IO.

A proc file will give you output like this so you can watch it die.

You can also manage CPU throttling network rate limiting and other bits
and bobs from the hardware node.  Also vzstat give a very nice running
commentary on the state of your box.

root at debian-r100-test-1:/# cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit
failcnt
       114: kmemsize        2959861    2963837   22111846   22754099
0
            lockedpages           0          0        512        512
0
            privvmpages       59963      59971 2147483647 2147483647
0
            shmpages           2564       2564      43008      43008
0
            dummy                 0          0          0          0
0
            numproc              57         57        480        480
0
            physpages         11500      11500          0 2147483647
0
            vmguarpages           0          0      67584 2147483647
0
            oomguarpages      12957      12957      52224 2147483647
0
            numtcpsock           16         17        720        720
0
            numflock             14         14        376        412
0
            numpty                1          1         32         32
0
            numsiginfo            0          0        512        512
0
            tcpsndbuf          8912      11832    3440640    5406720
0
            tcprcvbuf             0          0    3440640    5406720
0
            othersockbuf      21692      21692    2252160    4194304
0
            dgramrcvbuf      166772     166772     524288     524288
0
            numothersock         19         19        720        720
0
            dcachesize       382355     382929    7170240    7249920
0
            numfile            1113       1114      18624      18624
0
            dummy                 0          0          0          0
0
            dummy                 0          0          0          0
0
            dummy                 0          0          0          0
0
            numiptent            14         14        256        256
0

 12:32pm, up 105 days,  1:55,  0 users, load average: 1.11, 1.32, 1.57
VENum 18, procs 1342: R   1, S 1341, D   0, Z   0, T   0, X   0
CPU [ OK ]: VEs  33%, VE0   0%, user   6%, sys   2%, idle  92%, lat(ms)
6/0
Mem [ OK ]: total 3799MB, free 157MB/756MB (low/high), lat(ms) 0/0
  ZONE0 (DMA): size 16MB, act 0MB, inact 0MB, free 4MB (0/0/0)
  ZONE1 (Normal): size 816MB, act 65MB, inact 32MB, free 152MB (0/1/2)
  ZONE2 (HighMem): size 3007MB, act 2029MB, inact 184MB, free 756MB
(0/1/1)
  Mem lat (ms): A0 0, K0 0, U0 0, K1 0, U1 0
  Slab pages: 524MB/523MB (ino 257MB, de 156MB, bh 10MB, pb 20MB)
Swap [ OK ]: tot 8001MB, free 7342MB, in 0.000MB/s, out 0.000MB/s
Net [ OK ]: tot: in  0.022MB/s  180pkt/s, out  0.142MB/s  211pkt/s
             lo: in  0.000MB/s    0pkt/s, out  0.000MB/s    0pkt/s
           eth0: in  0.022MB/s  180pkt/s, out  0.142MB/s  211pkt/s
           eth1: in  0.000MB/s    0pkt/s, out  0.000MB/s    0pkt/s
Disks [ OK ]: in 0.066MB/s, out 0.389MB/s

  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP
     1 OK 3.8/27  0.4/1.9    0/55/256 0.0/5.0 110/1512    0    0
xx.xx.xx.xx
   103 OK 8.8/220772 0.4/2.7    0/55/480 0.4/5.0 40/1440    0    1
xx.xx.xx.xx
   114 OK 6.2/220772 0.3/2.7    0/54/480 0.3/5.0 34/1440    0    2
xx.xx.xx.xx
   119 OK 9.2/13  0.5/2.7    0/73/480 1.6/5.0 49/1440    0    1
xx.xx.xx.xx
   153 OK 9.6/220772 0.6/1.3    0/78/240 1.2/5.0  60/720    0    1
xx.xx.xx.xx
   161 OK 0.4/220772 0.1/0.3     0/14/65 0.0/5.0   9/160    0    0
xx.xx.xx.xx
   183 OK 9.6/220772 0.5/1.3    0/59/240 0.4/5.0  41/720    0    1
xx.xx.xx.xx
   202 OK 3.2/220772 0.4/259  0/53/32567 0.0/5.0 44/4294967294    0    0
xx.xx.xx.xx
   212 OK  11/220772 0.3/259  0/42/32567 0.0/5.0 27/4294967294    0    0
xx.xx.xx.xx
   217 OK 4.1/220772 0.4/259  0/47/32567 0.3/5.0 43/4294967294    0    1
xx.xx.xx.xx
   222 OK 5.9/220772 0.6/259  0/71/32567 1.2/5.0 74/4294967294    0    1
xx.xx.xx.xx
   224 OK 1.7/220772 0.2/259  0/29/32567 0.0/5.0 32/4294967294    0    0
xx.xx.xx.xx
   282 OK  12/220772 0.6/259  0/99/32567 0.0/5.0 128/4294967294    0
0 xx.xx.xx.xx
   290 OK 6.5/220772 0.7/1.2    0/78/300 1.9/5.0  82/600    0    6
xx.xx.xx.xx
   292 OK 6.9/220772 0.7/1.8    0/92/300 0.6/5.0  77/600    0    2
xx.xx.xx.xx
   300 OK 3.7/220772 0.3/1.1    0/36/600 0.2/10  42/2147484247    0    1
xx.xx.xx.xx
   352 OK  53/220772 0.6/1.1   0/174/600 0.2/10  107/1200    0    2
xx.xx.xx.xx
   369 OK 7.4/220772 0.4/1.2    0/51/300 0.0/5.0  40/600    0    0
xx.xx.xx.xx

-- 
Peace Jim :-)

  Computers make very fast, very accurate mistakes.

-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list