简体   繁体   English

可用分配的文件描述符总数始终为零-Ubuntu 14.04 LTS

[英]Total free allocated file descriptors always zero - Ubuntu 14.04 LTS

I have problem with free allocated file descriptors, it's always zero! 免费分配的文件描述符有问题,它始终为零!

For example: 例如:

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

AFAIK, that means following: AFAIK,这意味着:

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

As well I set following ulimits: 同样,我设置以下ulimit:

$ 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

System file maximum: 系统档案上限:

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

The most opened files are by Kannel daemons ( bearerbox and smppbox ). 打开最多的文件是Kannel守护程序( bearerboxsmppbox )。 Once the amount of opened files hit the limit smppbox is being stuck and only restart of it can help which isn't a solution at all. 一旦打开的文件数量达到限制, smppbox就会被卡住,只有重新启动它才能提供帮助,这根本不是解决方案。

As per the articles I found on internet I understand that there is no free alocated file descriptors in the system. 根据我在Internet上找到的文章,我了解系统中没有免费分配的文件描述符。

Every solution I've tried didn't help. 我尝试过的每个解决方案都无济于事。

What I'm doing wrong? 我做错了什么?

Need your help. 需要你的帮助。

Thank you in advance. 先感谢您。

As per the man page for proc : (emphasis mine) 按照proc手册页 :(强调我的)

/proc/sys/fs/file-nr / proc / sys / fs / file-nr
This (read-only) file contains three numbers: the number of allocated file handles (ie, the number of files presently opened); 该(只读)文件包含三个数字:已分配文件句柄的数量(即当前打开的文件数量); the number of free file handles; 空闲文件句柄的数量; and the maximum number of file handles (ie, the same value as /proc/sys/fs/file-max). 和最大文件句柄数(即,与/ 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. 在Linux 2.6之前,内核分配的文件是动态处理的,但是并没有再次释放它们。 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. 从Linux 2.6开始,内核确实释放释放的文件句柄,并且“空闲文件句柄”值始终为零。

So this will always be zero on kernel versions >= 2.6 因此,对于> = 2.6的内核版本,该值始终为零

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM