summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--draft/limit-io.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/draft/limit-io.txt b/draft/limit-io.txt
new file mode 100644
index 0000000..04307bb
--- /dev/null
+++ b/draft/limit-io.txt
@@ -0,0 +1,16 @@
+
+mount -t tmpfs cgroup_root /sys/fs/cgroup
+mkdir -p /sys/fs/cgroup/blkio
+mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
+
+
+dev=/dev/sda
+limit=10485760 # 10MBps
+mycg=/sys/fs/cgroup/blkio/limit_write/
+
+devnode=$(stat -c'%t:%T' /dev/sda)
+mkdir -p $mycg
+echo "$devnode $limit" > $mycg/blkio.throttle.write_bps_device
+
+echo $PID > $mycg/tasks
+