åæã§è©±é¡ã«ãªã£ã¦ãã¾ãããLinuxãåçã«é«éåããæ¹æ³ãçºè¦ããã¾ãã*1 *2 *3ãç¹ã«ãã©ã¦ã¶ãªã©è¤æ°ã®ã¢ããªã±ã¼ã·ã§ã³ãåæã«èµ·åããç¶æ ã§ã¯ãä½æé度ãã³ã£ããããã»ã©åä¸ãã¾ãã
é«éåããæ¹æ³ãç°¡åã§ããã«ã¼ãã«ã®åæ§ç¯ã¨ããé£ããä½æ¥ã¯ä¸è¦ã§ãè¨å®ãã¡ã¤ã«ãæ°è¡æ¸ãæããã ãã§ããæ¯é試ãã¾ãããï¼
ã¹ããã-1: ~/.bashrc ã®ç·¨é
~/.bashrc ã®æ«å°¾ã«ä»¥ä¸ã®4è¡ã追å ãã¾ãã
if [ "$PS1" ] ; then mkdir -m 0700 /sys/fs/cgroup/cpu/user/$$ echo $$ > /sys/fs/cgroup/cpu/user/$$/tasks fi
ã¹ããã-2: /etc/rc.local ã®ç·¨é
/etc/rc.local ã®æ«å°¾ã«ä»¥ä¸ã®2è¡ã追å ãã¾ã(2010/11/24æ´æ°ãä¸è¦ãªmkdirã³ãã³ããä¸ã¤åé¤ãã¾ãã)
mount -t cgroup cgroup /sys/fs/cgroup/cpu -o cpu mkdir -m 0777 /sys/fs/cgroup/cpu/user
ã¹ããã-3: åèµ·å
ã·ã¹ãã ãåèµ·åãã¾ãã
ä½æ¥ã¯ããã ãã§ããããã ãã§ãLinuxããã³ãã³åãããã«ãªãã¾ãã大çºè¦ã§ããã
è£è¶³(ãã®1)
ubuntu ã¯è¨å®æ¹æ³ãéãããã§ã
詳細㯠http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html ãè¦ã¾ãããã
(2010å¹´11æ24追è¨) fedora ã slackware ãªã©ã§ãè¨å®æ¹æ³ãç°ãªãå ´åãããããã§ãã詳細ã¯è£è¶³3ãè¦ã¦ãã ããã
è£è¶³(ãã®2)
ãã®è¨å®ã¯ãhttp://gihyo.jp/admin/clip/01/linux_dt/201011/18ãã«ããã«ã¼ãã«ãããã¨åæ§ã®å¹æãããã¾ããããã
- ç¾æç¹ã§ã¯ã«ã¼ãã«ãããã®ã§ããæªãç¹ï¼LKMLã§åé¡ç¹ãææããã¦ãã¾ãï¼
- æ軽ã«è©¦ããç¹(ã«ã¼ãã«ãåæ§ç¯ããªãã¦ãæ©æµãåãããã)
ãèããã¨å½é¢ã¯ãã®3ã¹ãããã§é«éåããæ¹æ³ãé¸ãã æ¹ãå¾çã ã¨æãã¾ãã
è£è¶³(ãã®3) (2010å¹´11æ24追è¨)
ä¸è¨è¨å®ãè¡ã㨠/sys/fs/cgroup/cpu/user ã¨ãããã£ã¬ã¯ããªãåºæ¥ä¸ããã¾ããubuntu ã®å ´åã¯ãã£ã¬ã¯ããªåãéã£ã¦ /dev/cgroup/userãã§ãã
ããã¦ãæ°ããããã»ã¹(âããã°ã©ã ãã¢ããªã±ã¼ã·ã§ã³ï¼ãèµ·åããã¨ã/sys/fs/cgroup/cpu/user/<ããã»ã¹ID>ãã¨ãããã£ã¬ã¯ããªãèªåçæããã¾ãã
ãã®ãããªãã£ã¬ã¯ããªãã§ããªãå ´åã¯ã以ä¸ã®ããã«å°ãpathãå¤ãã¦è©¦ãã¦ã¿ã¾ãããã詳細ã¯æªç¢ºèªã§ããfedoraã¯ãã®ããã«å°ããã¹ãå¤ããã¨ãã¾ãè¡ã£ãããã§ãã
~/.bashrc ã«è¿½è¨ããé¨åã以ä¸ã®ãã®ã«å¤æ´
if [ "$PS1" ] ; then mkdir -m 0700 /sys/fs/cgroup/user/$$ echo $$ > /sys/fs/cgroup/user/$$/tasks fi
/etc/rc.local ã®æ«å°¾ã¯
mount -t cgroup cgroup /sys/fs/cgroup -o cpu mkdir -m 0777 /sys/fs/cgroup/user
è£è¶³ï¼ãã®4ï¼
åä½åçã«ã¤ãã¦æ°ã«ãªã人ã¯ãcgroups.txt ãè¦ã¾ãããã
http://www.mjmwired.net/kernel/Documentation/cgroups.txt
cgroups.txt ã¯ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ãã«å梱ããã¦ãããã¡ã¤ã«ã§ããææ°çãèªã¿ããå ´åã¯
ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ããå±éãã¦ããã®ãªãã®ãDocumentation/cgroups.txtããè¦ãã¨è¯ãã§ãã