欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

Notice : Soft open files now is 1024, We recommend greater than 10000

发布时间:2025/3/21 编程问答 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Notice : Soft open files now is 1024, We recommend greater than 10000 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

在研究 workerman 时, 报了这个错误, 感觉只是个notice级别的, 就一直给忽略掉了, 今天有时间, 就查了一下.

其实本质就是 ulimit 这个命令

打开一个命令行, 输入 ulimit -a

可以查看到, 当前系统所有的限制

[root@butterfly ~]# 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) 3858
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) 3858
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

默认 open files 是 1024 

打开这个文件 /etc/security/limits.conf 

添加如下两行 

* soft nofile 99999
* hard nofile 99999

重启一下系统,

再输入 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) 30690
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 99999
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) 30690
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

就ok了

点击查看关于此命令详细介绍 

转载于:https://www.cnblogs.com/debmzhang/p/4262562.html

总结

以上是生活随笔为你收集整理的Notice : Soft open files now is 1024, We recommend greater than 10000的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。