0
点赞
收藏
分享

微信扫一扫

ulimit -n 修改最大 链接数

使用 ulimit -n 65535 可即时修改,但重启后就无效了。

ulimit -n 65535

永久生效方式,编辑配置文件:/etc/security/limits.conf,在末尾添加,然后重启系统:

*        soft    noproc  65535
* hard noproc 65535
* soft nofile 65535
* hard nofile 65535

使用ulimit -a 可以查看当前系统的所有限制值,使用ulimit -n 可以查看当前的最大打开文件数。

# 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) 127948
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) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 127948
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

# ulimit -n
1024
# ulimit -n 65535
# ulimit -n
65535
举报

相关推荐

0 条评论