为了与老版本的Unix或者Linux兼容,PID的最大值默认设置位32768(short int 短整型的最大值)。
The value in file-max denotes the maximum number of file handles that the Linux kernel will allocate).当收到”Too many open files in system”这样的错误消息时, 就应该曾加这个值了.
对于2.2的内核, 还需要考虑inode-max, 一般inode-max设置为file-max的4倍. 对于2.4及以后的内核, 没有inode-max这个文件了.查看实际值
echo 1000000 > /proc/sys/fs/file-max
fs.file-max = 1000000nr_open是单个进程可分配的最大文件数
the maximum number of files that can be opened by process。A process cannot use more than NR_OPEN file descriptors.一个进程不能使用超过NR_OPEN文件描述符。12
ulimit -n[attach]52208[/attach]
echo 2000000 > /proc/sys/fs/nr_openfile-max, nr_open, onfile之间的关系
“maximum number of open files”,它其实对应是单个进程能打开的最大文件数,通常为了省事,我们想取消它的限制
bash: ulimit: open files: cannot modify limit: 不允许的操作
执行:grep -r MemTotal /proc/meminfo | awk ‘{printf(“%d”,$2/10)}’,可以看到与file-max是相近的;
欢迎光临 嵌入式开发交流网论坛 (http://www.dianzixuexi.com/bbs/) | Powered by Discuz! X3.2 |