Well, i’ve continued my little crusade for rate limits…
I have to configure the vif line by hand on the .cfg file for the testing xen machine. I did discoverd some interesting facts:
- rate limits dont apply form exterior to downloading from outside the VM
- Rates do apply for “giving” information / Data, from the VM to the outside world.
test 1
0% [ ] 891,695 29.2K/s eta 56m 21s ^C
test 2
1% [ ] 1,654,791 106K/s eta 15m 59s ^C
test 3
68% [=========================> ] 69,358,552 5.18M/s eta 12s ^71%
This was all tested in a VM with the following configuration:
[root@formador xen]# cat teste5.cfg
kernel = ‘/xen/vmlinuz-vm2-xenU’
ramdisk = ‘/xen/initrd.vm2.xenU.img’
memory = 256
name = ‘teste5’
address = ‘192.168.122.180’
netmask = ‘255.255.255.0’
disk = [‘file:/xen/teste5.img,sda1,w’]
root = ‘/dev/sda1 ro’
vif=[‘rate=7096KB/s’]
vnc = 5901
vnclisten = “127.0.0.1”
vncdisplay = 1
vncpasswd = “xpto???”
I also decided to check on xenstore-ls if XEN was actually putting rates on the vifs .
xenstore-ls /local/domain/0 | grep rate
rate = "150000,50000"
This rate is correct for rate=3MB/s
Well… for limiting my clients for a particular plan it works for me… for now. Using this, they wont be able to “serve” more than the rate that I define, but will be able to download at will, when inside the VM of course.
I did try to use the “other configuration options” when creating the Xen System. However, i was presented with an error in the .cfg file when starting the VM. I went to read the .cfg file and discovered that Cloudmin script wrote a newline in the .cfg file with the option that i used (rate=7096KB/s) :
…
vif=[’’]
rate=7096KB/s
…
So if it could be done the same thing as the vif name, that actually writes between the brackets of the vif line ( vif=[‘vifname=myVif’] ), and we would have then the rate limits for a particular VM already when creating it, without the work of manually configure it after the creation.
Just a sugestion…
Regards,
F