/[sysadmin-cookbook]/recepies/lxc/kvm/10-cgroup-blkio/disk-speed.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /recepies/lxc/kvm/10-cgroup-blkio/disk-speed.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 262 - (hide annotations)
Sun May 15 00:08:10 2011 UTC (13 years ago) by dpavlin
File MIME type: application/x-sh
File size: 682 byte(s)
create containers for blkio disk speed test
1 dpavlin 262 #!/bin/sh -xe
2    
3     lxc-ls | xargs -i sh -c "lxc-stop -n {} ; lxc-destroy -n {}"
4    
5     echo "lxc.network.type = empty" > blkio.conf
6    
7     PATH=$(pwd):$PATH lxc-create -f blkio.conf -t busybox -n disk1
8     PATH=$(pwd):$PATH lxc-create -f blkio.conf -t busybox -n disk2
9     PATH=$(pwd):$PATH lxc-create -f blkio.conf -t busybox -n disk3
10    
11     lxc-ls | xargs -i dd if=/dev/zero of=/var/lib/lxc/{}/rootfs/tmp/zero bs=1M count=100
12    
13     cat > /tmp/speed.sh <<EOF
14     #!/bin/sh
15     while true ; do
16     sync ; echo 3 > /proc/sys/vm/drop_caches
17     dd if=/tmp/zero of=/dev/null 2>&1
18     done | grep MB
19     EOF
20    
21     chmod +x /tmp/speed.sh
22    
23     lxc-ls | xargs -i cp /tmp/speed.sh /var/lib/lxc/{}/rootfs/tmp/speed.sh
24    
25     lxc-ls | xargs -i lxc-start -d -n {}
26    

  ViewVC Help
Powered by ViewVC 1.1.26