Skip to content

Instantly share code, notes, and snippets.

@realpg
Last active May 14, 2024 17:54
Show Gist options
  • Save realpg/f36ae7bc655d7eab6903fad82ead65f8 to your computer and use it in GitHub Desktop.
Save realpg/f36ae7bc655d7eab6903fad82ead65f8 to your computer and use it in GitHub Desktop.
#!/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
@realpg
Copy link
Author

realpg commented May 14, 2024

用root执行!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment