ulimit -a /proc/sys/fs/file-nr 数字解析

 

 

file-nr:

 

Historically, the three values in file-nr denoted the number of
allocated file handles, the number of allocated but unused file
handles, and the maximum number of file handles. Linux 2.6 always
reports 0 as the number of free file handles – this is not an error, it
just means that the number of allocated file handles exactly matches
the number of used file handles. 

 

 

 

ulimit -c    :  该结果中nofile是当前程序file handler资源限制 ,默认一般为1024

 

对普通用户是不能够超过这个值的(1024) 但是对超级用户是可以超过这个值的。

 

 

file-max  : 文件系统最大file handler 数目

 

/proc/pid/fd/     目录下面详细显示了pid进程所占用的file handler ,当然一般file handler 太大都是因为socket忘记关闭导致。

 

综合以上分析, 也就会出现  在一个程序中, socket 资源被占用完,同时, 其他程序能够正常的运行 。 这是因为对每个程序都有1024 个file handler的限制, 同时,所有程序的总和用file-max 现在, 所以, 一个程序socket 资源用完了一般不影响其他的程序,但是当这样的程序太多了导致超过文件系统规定的最大数目(file-max) , 其他的程序当然就会受影响了

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值