本文共 2321 字,大约阅读时间需要 7 分钟。
1 /etc/security/limits与limit命令 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里面也是可以修改的 转载于:https://www.cnblogs.com/limt/p/4199252.html