Skip to content

Instantly share code, notes, and snippets.

@hayajo
Created May 19, 2016 13:44
Show Gist options
  • Save hayajo/7041429aedf361a0b30c103e9733d0dc to your computer and use it in GitHub Desktop.
Save hayajo/7041429aedf361a0b30c103e9733d0dc to your computer and use it in GitHub Desktop.
cgroupのcpu.shareを試す
#!/bin/sh
group=/sys/fs/cgroup/cpu/$(basename $0)-$$
mkdir $group
echo $$ > $group/tasks
echo $1 > $group/cpu.shares
exec /bin/sh -c 'yes >> /dev/null'
@hayajo
Copy link
Author

hayajo commented May 19, 2016

# ./cg_share.sh 1024 &
# ./cg_share.sh 512 &
# ./cg_share.sh 256 &
# ps uf

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