乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Linux遭遇Too many open files

       king9413 2010-06-22

      比較流行的發(fā)行版本,比如Debian/Ubuntu/Arch Linux/Gentoo的shell session限制都是1024。

      大多數(shù)Linux發(fā)行版本中,正常情況下session中max open files數(shù)限制為1024,對于Weblogic Server部署過程來說太小了,必須增大。

      臨時(shí)解決方法:
      只對某個(gè)Terminal中的session起作用,用以下命令增加該數(shù)值。
      ulimit -n 2048
      繼續(xù)在此session中啟動(dòng)obpmadmcenter來配置directory和創(chuàng)建新的WLS domain用于部署bpm。如果選擇修改一個(gè)已經(jīng)存在的WLS domain的話,在執(zhí)行啟動(dòng)腳本的Terminal session中需要用同樣的方法增加該數(shù)值,否則多數(shù)會(huì)得到同樣的錯(cuò)誤。
      ulimit -a
      可以用來查看當(dāng)前session user的各種限制,當(dāng)然包括修改過的數(shù)值。


      永久性解決方法:

      1. 修改/etc/security/limits.conf (root)
      增加如下
      $user hard nofile 2048
      $user是用來啟動(dòng)WLS的用戶。
      2048是建議的數(shù)值,若遇到同樣問題可能需要再次增加。

      或者干脆用*表示所有用戶:

      * soft nofile 2048
      * hard nofile 4096

      2. 其他來自Debian GNU/Linux官方文檔和Oracle Technology Network的解決方法,直接修改內(nèi)核參數(shù),無須重啟系統(tǒng)。
      sysctl -w fs.file-max 65536
      或者
      echo "65536" > /proc/sys/fs/file-max
      兩者作用是相同的,前者改內(nèi)核參數(shù),后者直接作用于參數(shù)對應(yīng)的虛擬文件系統(tǒng)(procfs, psuedo file system)上對應(yīng)的文件而已。
      可以用以下的命令查看新的限制
      sysctl -a | grep fs.file-max
      或者
      cat /proc/sys/fs/file-max

      修改內(nèi)核參數(shù)
      /etc/sysctl.conf
      echo "fs.file-max=65536" >> /etc/sysctl.conf
      sysctl -p

      查看當(dāng)前file handles使用情況:

      sysctl -a | grep fs.file-nr

      或者

      cat /proc/sys/fs/file-nr
      825 0 65536

      另外一個(gè)命令:
      lsof | wc -l
      有點(diǎn)讓我困惑的是,以上兩個(gè)命令獲得的結(jié)果總是不相同的;-(

      此外,用sysctl來修改內(nèi)核參數(shù)fs.file-max和用ulimit的區(qū)別,我花了不少時(shí)間研究,討教了Linux/FreeBSD/Solaris/OpenSolaris老鳥Jockey同學(xué),得到點(diǎn)撥之后終于基本弄清楚原委了。

      基本上優(yōu)先級:
      soft limit < hard limit < kernel < 實(shí)現(xiàn)最大file descriptor數(shù)采用的數(shù)據(jù)結(jié)構(gòu)所導(dǎo)致的限制

      The Linux kernel provides the getrlimit and setrlimit system calls to get and set resource limits per process. Each resource has an associated soft and hard limit. The soft limit is the value that the kernel enforces for the corresponding resource. The hard limit acts as a ceiling for the soft limit: an unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process (one with the CAP_SYS_RESOURCE capability) may make arbitrary changes to either limit value.

        本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多