AIX 5.3上
下面是檔/etc/security/limits檔裡面有關軟限制和硬限制的部分。
*
* Sizes are in multiples of 512 byte blocks, CPU time is in seconds
*
* fsize - soft file size in blocks
* core - soft core file size in blocks
* cpu - soft per process CPU time limit in seconds
* data - soft data segment size in blocks
* stack - soft stack segment size in blocks
* rss - soft real memory usage in blocks
* nofiles - soft file descriptor limit
* fsize_hard - hard file size in blocks
* core_hard - hard core file size in blocks
* cpu_hard - hard per process CPU time limit in seconds
* data_hard - hard data segment size in blocks
* stack_hard - hard stack segment size in blocks
* rss_hard - hard real memory usage in blocks
* nofiles_hard - hard file descriptor limit
* The following table contains the default hard values if the
* hard values are not explicitly defined:
*
* Attribute Value
* ========== ============
* fsize_hard set to fsize
* cpu_hard set to cpu
* core_hard -1
* data_hard -1
* stack_hard 8388608
* rss_hard -1
* nofiles_hard -1
default:
fsize = -1
core = 2097151
cpu = -1
data = -1
rss = -1
stack = -1
nofiles = 2000
說明:
1.ulimit -Ha 輸出硬限制的值
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 4194304
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) unlimited
因為在/etc/security/limits沒有明確寫明對硬限制的設置,所以,取默認的硬限制的值,也就是上面注釋文字
裡 面寫的那些,stack還是有限制的。
2.
ulimit -a 輸出軟限制的值
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 4194304
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 2000
軟限制取/etc/security/limits
裡 面default
裡 面的值,雖然
裡 面寫的stack沒限制,但是由於硬限制已經提前限制了41944304,所以,stack的最大也只能是41944304。
3.如何更改硬限制和軟限制的值?
1) 編輯檔/etc/security/limits,直接修改各定義值。此更改在用戶退出重新登陸就生效。
2) 使用命令ulimit修改預設值。例如:
ulimit -f value
ulimit -c
ulimit -t
ulimit -d
ulimit -s
ulimit -m
ulimit -n
將修改fsize, core, cpu,data, stack, rss和nofiles的soft limit值。
3) 使用命令chuser修改某用戶的限定值。例如:
chuser fsize=
chuser core=
chuser data=
chuser limit=
chuser rss=
chuser nofiles=
將用戶"username"的soft limits改為值"value"。
chuser hard_fsize=
chuser hard_core=
chuser hard_cpu=
chuser hard_data=
chuser hard_limit=
chuser hard_rss=
chuser hard_nofiles=
將用戶"username"的hard limits改為值"value"。
4)打smit chuser
裡面也是可以修改的
--
例如要修改AP Server 的連線數 或DB 的連線數
將其由2048 ==>4096 :
chuser nofiles=4096 oracle
chuser hard_nofiles=4096 oracle
# lsattr -El
sys0 |grep maxuproc
maxuproc 1024 Maximum number of PROCESSES
allowed per user
True
# chdev -l
sys0 -a maxuproc=4096
sys0
changed
# lsattr -El
sys0 |grep maxuproc
maxuproc 4096 Maximum number of PROCESSES
allowed per user
True
#
沒有留言:
張貼留言