Last active
May 14, 2024 17:54
-
-
Save realpg/f36ae7bc655d7eab6903fad82ead65f8 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 | |
echo "+io" >/sys/fs/cgroup/cgroup.subtree_control | |
mkdir /sys/fs/cgroup/limitio | |
ls -la /dev/block/ | grep -v '/loop' | grep -v '/sr' | awk '{print $1, $2, $3, $4, $5, $9}' | grep -oP '\d+:\d+' | while read line | |
do | |
echo "$line wbps=52428800 rbps=52428800" > /sys/fs/cgroup/limitio/io.max 2>/dev/null | |
done | |
echo $$ > /sys/fs/cgroup/limitio/cgroup.procs | |
#this script's disk read and write are both set to 50MB/s, plz add your gzip -d command below | |
#gzip -d a.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
用root执行!