码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-01-30 17:03:26      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:

在研究 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了

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

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

标签:

原文地址:http://www.cnblogs.com/debmzhang/p/4262562.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!