gpt4 book ai didi

linux - 免费分配的文件描述符总数始终为零 - Ubuntu 14.04 LTS

转载 作者:太空宇宙 更新时间:2023-11-04 10:21:06 27 4
gpt4 key购买 nike

我对自由分配的文件描述符有疑问,它始终为零!

例如:

$ cat /proc/sys/fs/file-nr
4448 0 1529806

据我所知,这意味着以下内容:

4448 is total alocated file descriptors
0 is total of free alocated file descriptors
1529806 is the total limit of the system

我还设置了以下 ulimits:

$ 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) 120242
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
**open files (-n) 500000**
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) 120242
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

系统文件最大值:

$ cat /proc/sys/fs/file-max
1529806

打开次数最多的文件是由 Kannel 守护程序(bearerboxsmppbox)打开的。一旦打开的文件数量达到限制,smppbox 就会被卡住,只有重新启动它才能有所帮助,这根本不是解决方案。

根据我在互联网上找到的文章,我了解到系统中没有免费分配的文件描述符。

我尝试过的所有解决方案都没有帮助。

我做错了什么?

需要你的帮助。

提前谢谢你。

最佳答案

根据 man page for proc : (强调我的)

/proc/sys/fs/file-nr
This (read-only) file contains three numbers: the number of allocated file handles (i.e., the number of files presently opened); the number of free file handles; and the maximum number of file handles (i.e., the same value as /proc/sys/fs/file-max). If the number of allocated file handles is close to the maximum, you should consider increasing the maximum. Before Linux 2.6, the kernel allocated file handles dynamically, but it didn't free them again. Instead the free file handles were kept in a list for reallocation; the "free file handles" value indicates the size of that list. A large number of free file handles indicates that there was a past peak in the usage of open file handles. Since Linux 2.6, the kernel does deallocate freed file handles, and the "free file handles" value is always zero.

所以在内核版本 >= 2.6 上这将始终为零

关于linux - 免费分配的文件描述符总数始终为零 - Ubuntu 14.04 LTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43870640/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com