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 : 文件系統(tǒng)最大file handler 數(shù)目
/proc/pid/fd/ 目錄下面詳細顯示了pid進程所占用的file handler ,當然一般file handler 太大都是因為socket忘記關閉導致。
綜合以上分析, 也就會出現(xiàn) 在一個程序中, socket 資源被占用完,同時, 其他程序能夠正常的運行 。 這是因為對每個程序都有1024 個file handler的限制, 同時,所有程序的總和用file-max 現(xiàn)在, 所以, 一個程序socket 資源用完了一般不影響其他的程序,但是當這樣的程序太多了導致超過文件系統(tǒng)規(guī)定的最大數(shù)目(file-max) , 其他的程序當然就會受影響了
本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/aobai219/archive/2010/09/07/5868640.aspx
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請
點擊舉報。