這篇文章主要介紹了solaris10如何使用projadd進行資源限制的添加,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
在安裝oracle時,需要進行資源限制配置:
noexec_user_stack=1
semsys:seminfo_semmni=100
semsys:seminfo_semmns=1024
semsys:seminfo_semmsl=256
semsys:seminfo_semvmx=32767
shmsys:shminfo_shmmax=4294967295
shmsys:shminfo_shmmni=100
rlim_fd_max=65536
rlim_fd_cur=4096
maxuprc=16384
max_nprocs=3000
使用project(立即生效,永久)
project是Solaris10新增加的特性,可以通過設(shè)置project參數(shù)為一個用戶或一組用戶設(shè)置參數(shù)值。設(shè)置后可立即生效。
'但是,root用戶的結(jié)果只受/etc/system里參數(shù)的影響,而不受project user.oracle影響,root用戶不屬于此project. '
以下是設(shè)置示例:
--root執(zhí)行
bash-3.2# :/ #>projadd user.oracle (創(chuàng)建project user.oracle)
bash-3.2# :/ #>id -p oracle
uid=100(oracle) gid=1(other) projid=100(user.oracle) (oracle用戶屬于project user.oracle)
bash-3.2# :/ #>projmod -a -K "process.max-file-descriptor=(basic,65534,deny)" user.oracle
bash-3.2# :/ #>projmod -a -K "process.max-file-descriptor=(priv,65535,deny)" user.oracle
bash-3.2# :/ #>grep 'user.oracle' /etc/project
user.oracle:100::::process.max-file-descriptor=(basic,65534,deny),(priv,65535,deny)
設(shè)置basic和privilege值分別為65534和65535,不能越過/etc/system中的大硬限制65535;
bash-3.2# :/ #>tail -2 /etc/system
set rlim_fd_cur=1024
set rlim_fd_max=65535
bash-3.2# plimit
13110: bash
resource current maximum
time(seconds) unlimited unlimited
file(blocks) unlimited unlimited
data(kbytes) unlimited unlimited
stack(kbytes) 10240 unlimited
coredump(blocks) unlimited unlimited
nofiles(descriptors) 256 65536
vmemory(kbytes) unlimited unlimited
bash-3.2#
root用戶的結(jié)果只受/etc/system里參數(shù)的影響,而不受project user.oracle影響,root用戶不屬于此project.
bash-3.2# su - oracle
Oracle Corporation SunOS 5.10 Generic Patch January 2005
-sh: TEMP=/tmp: is not an identifier
$ bash
bash-3.2$ plimit
13110: bash resource current maximum time(seconds) unlimited unlimited file(blocks) unlimited unlimited data(kbytes) unlimited unlimited stack(kbytes) 10240 unlimited coredump(blocks) unlimited unlimited nofiles(descriptors) 256 65536 vmemory(kbytes) unlimited unlimited bash-3.2# root用戶的結(jié)果只受/etc/system里參數(shù)的影響,而不受project user.oracle影響,root用戶不屬于此project. bash-3.2# su - oracle Oracle Corporation SunOS 5.10 Generic Patch January 2005 -sh: TEMP=/tmp: is not an identifier $ bash bash-3.2$ plimit
14704: bash
resource current maximum
time(seconds) unlimited unlimited
file(blocks) unlimited unlimited
data(kbytes) unlimited unlimited
stack(kbytes) 10240 unlimited
coredump(blocks) unlimited unlimited
nofiles(descriptors) 65534 65535
vmemory(kbytes) unlimited unlimited
bash-3.2$
--同樣如上進行需要修改其他參數(shù):
noexec_user_stack=1
semsys:seminfo_semmni=100
semsys:seminfo_semmns=1024
semsys:seminfo_semmsl=256
semsys:seminfo_semvmx=32767
shmsys:shminfo_shmmax=4294967295
shmsys:shminfo_shmmni=100
rlim_fd_max=65536
rlim_fd_cur=4096
maxuprc=16384
max_nprocs=3000
projmod -a -K "project.max-sem-ids=(priv,100,deny)" user.oracle
projmod -a -K "process.max-sem-nsems=(priv,256,deny)" user.oracle
projmod -a -K "project.max-shm-memory=(priv,4294967295,deny)" user.oracle
projmod -a -K "project.max-shm-ids=(priv,100,deny)" user.oracle
---------------------
感謝你能夠認真閱讀完這篇文章,希望小編分享的“solaris10如何使用projadd進行資源限制的添加”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,更多相關(guān)知識等著你來學習!