Created
April 3, 2017 14:07
-
-
Save karampok/f78997c010c03e7b521d9997ca791886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
runs=$(seq 100 200 1000) | |
dir=/var/vcap/data | |
echo cfq > /sys/block/sda/queue/scheduler | |
#create files, need different files not to share cached one | |
for i in $runs; do | |
echo $i > /sys/fs/cgroup/blkio/test$i/blkio.weight | |
cat /sys/fs/cgroup/blkio/test$i/blkio.weight | |
done | |
#create cgroups blkio directories | |
for i in $runs; do | |
mkdir -p /sys/fs/cgroup/blkio/test$i | |
done | |
#write part | |
for i in $runs; do | |
dd if=/dev/zero of=$dir/file$i bs=512M count=1 | |
#dd if=/dev/zero of=$dir/file$i bs=512M count=1 >>/tmp/write-output 2>&1 & | |
#echo $! > /sys/fs/cgroup/blkio/test$i/tasks | |
#cat /sys/fs/cgroup/blkio/test$i/tasks | |
done | |
#exit | |
#clean files from caches | |
sync | |
echo 3 > /proc/sys/vm/drop_caches | |
#read part | |
for i in $runs; do | |
dd if=$dir/file$i of=/dev/null >>/tmp/read-output 2>&1 & | |
echo $! > /sys/fs/cgroup/blkio/test$i/tasks | |
cat /sys/fs/cgroup/blkio/test$i/tasks | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment