Projects
From pressy's brainbackup
Contents
Projects
Overview
Old Old New New Resource control tunable default Max value default ---------------------- ------------- ------- --------- ---------- process.max-msg-qbytes msginfo_msgmnb 4096 ULONG_MAX 65536 process.max-msg-messages msginfo_msgtql 40 UINT_MAX 8192 process.max-sem-ops seminfo_semopm 10 INT_MAX 512 process.max-sem-nsems seminfo_semmsl 25 SHRT_MAX 512 project.max-shm-memory shminfo_shmmax 0x800000 UINT64_MAX 1/4 physmem project.max-shm-ids shminfo_shmmni 100 2**24 128 project.max-msg-ids msginfo_msgmni 50 2**24 128 project.max-sem-ids seminfo_semmni 10 2**24 128
Not used anymore
Shared Memory Semaphores Message-Queue -------------- -------------- --------------- shminfo_shmseg seminfo_semmns msginfo_msgmax shminfo_shmmin seminfo_semvmx msginfo_msgssz shminfo_shmmax* seminfo_semmnu msginfo_msgmni* shminfo_shmmni* seminfo_semaem msginfo_msgtql* seminfo_semume msginfo_msgmnb* seminfo_semusz msginfo_msgmap seminfo_semmap msginfo_msgseg seminfo_semmsl* seminfo_semopm* seminfo_semmni*
values ending in * are technically obsolete, but if they are present in the /etc/system file then at boot the kernel will translate the values into global resource controls.
How to configure
# projadd -c "disc blabla" group.<name> # projmod -sK "project.max-shm-memory=(privileged,2g,deny)" \ group.<name> # projects -l # prstat -T # id -p # prctl -n project.max-shm-memory -i process $$
To set the user's default project (/etc/user_attr):
# usermod -K project=<proj> <user>
Change & Modify
# prctl -n project.max-shm-memory -r -v 4g -i project <proj-name> # projmod -rK "project.max-shm-memory=(privileged,2g,deny)" user.pressy # projmod -rK project.max-shm-memory <proj-name> # projdel <proj-name>
To start up a process under a project, run:
newtask -p <project> command
A running process can be associated with the project:
newtask -v -p <project> -c <PID>
Test it
Eat some memory (eg. 100MB)
# perl -e '$a = "pressy" x 8_200_000; sleep 3600' &
Burn CPU
# perl -e 'while (true){$x=sqrt(2.0);}' # perl -e 'while (1) { \$cpuflog++ }
Oracle Example
This is a running project on a supercluster:
user.oracle projid : 105 comment: "" users : (none) groups : (none) attribs: process.max-core-size=(privileged,1073741824,deny) process.max-file-descriptor=(basic,65536,deny) process.max-sem-nsems=(privileged,2048,deny) process.max-sem-ops=(privileged,1024,deny) process.max-stack-size=(basic,33554432,deny) project.max-msg-ids=(privileged,4096,deny) project.max-port-ids=(priv,16384,deny) project.max-sem-ids=(privileged,65535,deny) project.max-shm-ids=(privileged,4096,deny) project.max-shm-memory=(privileged,2199023255552,deny)