原文链接:https://blog.csdn.net/lck5602/article/details/79670147
当你的服务器在大并发达到极限时,就会报出“too many open files”。
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) 59367
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) 59367
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
其中:
open files (-n) 1024 代表每个
more /proc/sys/fs/file-max
lsof|awk '{print $2}'|wc -l
lsof|awk '{print $2}'|sort|uniq -c|sort -nr|more
ps -ef |grep
修改linux系统参数。vi /etc/security/limits.conf 添加
* soft nofile 65536
* hard nofile 65536
修改以后保存,注销当前用户,重新登录,执行ulimit -a ,ok ,参数生效了:
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://forezp.blog.csdn.net/article/details/109239557
内容来源于网络,如有侵权,请联系作者删除!