- 论坛徽章:
- 0
|
本帖最后由 jay_chiang 于 2016-02-25 14:38 编辑
下午好,有一个关于linux配置ulimit的问题想咨询下各位。
--OS release
[root@localhost ~]# more /etc/redhat-release
CentOS release 6.2 (Final)
--limits.conf设置
[root@localhost ~]# tail -10 /etc/security/limits.conf
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
# End of file
* - nofile 65536
* - nproc 16384
--90-nproc.conf设置
[root@localhost ~]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 16384
root soft nproc unlimited
问题来了:
无论是root用户还是别的普通用户,从别的主机ssh跳过来时 执行ulimit -a并没有显示相应的openfile值和maxprocesses值,需要su - 本用户或者别的用户才能显示出之前设置的openfile和maxprocesses值,这是为啥?具体如下:
[crmxx@server-xx-xx ~]$ ssh test1@192.168.xx.xx
test1@192.168.xx.xx's password:
Last login: Thu Feb 25 14:16:40 2016 from 192.170.xx.xx
[test1@localhost ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1033120
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1033120
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[test1@localhost ~]$ su - test1
Password:
[test1@localhost ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1033120
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[test1@localhost ~]$
请各位指导 |
|