您的位置:首页 > 运维架构 > Linux

修改Linux的open files参数是,立即生效,无需重启

2016-12-20 11:41 477 查看
通过命令ulimit -a查看的open files参数的修改:
[root@nginx ~]# 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) 7697
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
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) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
通过命令ulimit -n number可以直接修改,但是修改的只是当前会话的open files,重新打开一个连接查看的open files还是原来的。

修改配置文件/etc/security/limits.conf 添加
* soft nofile 65535
* hard nofile 65535
注意格式,会立即生效,重新连接一下就可以看到了,ulimit -a。

不需要重启,就会立即生效的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Linux 修改 open
相关文章推荐