mongodb too many open files

來源:互聯網
上載者:User
關鍵字 php mongodb
問題描述:

   mac osx 環境   通過tcp測試載入器,建立3000個串連,就報 too many open files 具體錯誤:`2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:771906][60793:0x70000020a000], log-server: /data/db/journal: opendir: Too many open files in system2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:772155][60793:0x70000020a000], log-server: dirlist journal prefix WiredTigerPreplog: Too many open files in system2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:772199][60793:0x70000020a000], log-server: log pre-alloc server error: Too many open files in system2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:772239][60793:0x70000020a000], log-server: log server error: Too many open files in system2016-05-11T00:59:33.022+0800 W FTDC     [ftdc] Uncaught exception in 'FileNotOpen: Failed to open interim file /data/db/diagnostic.data/metrics.interim.temp' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem.2016-05-11T00:59:33.566+0800 E STORAGE  [thread2] WiredTiger (23) [1462899573:566795][60793:0x700000393000], file:WiredTiger.wt, WT_SESSION.checkpoint: WiredTiger.turtle: fopen: Too many open files in system2016-05-11T00:59:33.568+0800 E STORAGE  [thread2] WiredTiger (23) [1462899573:568812][60793:0x700000393000], checkpoint-server: checkpoint server error: Too many open files in system2016-05-11T00:59:33.568+0800 E STORAGE  [thread2] WiredTiger (-31804) [1462899573:568879][60793:0x700000393000], checkpoint-server: the process must exit and restart: WT_PANIC: WiredTiger library panic2016-05-11T00:59:33.568+0800 I -        [thread2] Fatal Assertion 285582016-05-11T00:59:33.568+0800 I -        [thread2] 

`

回複內容:

問題描述:

   mac osx 環境   通過tcp測試載入器,建立3000個串連,就報 too many open files 具體錯誤:`2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:771906][60793:0x70000020a000], log-server: /data/db/journal: opendir: Too many open files in system2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:772155][60793:0x70000020a000], log-server: dirlist journal prefix WiredTigerPreplog: Too many open files in system2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:772199][60793:0x70000020a000], log-server: log pre-alloc server error: Too many open files in system2016-05-11T00:59:29.772+0800 E STORAGE  [thread1] WiredTiger (23) [1462899569:772239][60793:0x70000020a000], log-server: log server error: Too many open files in system2016-05-11T00:59:33.022+0800 W FTDC     [ftdc] Uncaught exception in 'FileNotOpen: Failed to open interim file /data/db/diagnostic.data/metrics.interim.temp' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem.2016-05-11T00:59:33.566+0800 E STORAGE  [thread2] WiredTiger (23) [1462899573:566795][60793:0x700000393000], file:WiredTiger.wt, WT_SESSION.checkpoint: WiredTiger.turtle: fopen: Too many open files in system2016-05-11T00:59:33.568+0800 E STORAGE  [thread2] WiredTiger (23) [1462899573:568812][60793:0x700000393000], checkpoint-server: checkpoint server error: Too many open files in system2016-05-11T00:59:33.568+0800 E STORAGE  [thread2] WiredTiger (-31804) [1462899573:568879][60793:0x700000393000], checkpoint-server: the process must exit and restart: WT_PANIC: WiredTiger library panic2016-05-11T00:59:33.568+0800 I -        [thread2] Fatal Assertion 285582016-05-11T00:59:33.568+0800 I -        [thread2] 

`

可以先查看一下允許多少個開啟檔案

Yaoxings-MacBook-Pro:db yaoxing$ ulimit -acore file size          (blocks, -c) 0data seg size           (kbytes, -d) unlimitedfile size               (blocks, -f) unlimitedmax locked memory       (kbytes, -l) unlimitedmax memory size         (kbytes, -m) unlimitedopen files                      (-n) 256pipe size            (512 bytes, -p) 1stack size              (kbytes, -s) 8192cpu time               (seconds, -t) unlimitedmax user processes              (-u) 709virtual memory          (kbytes, -v) unlimited

實際上一進入mongoshell就會提示你這一點

2016-05-11T17:45:17.536+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

WiredTiger的工作原理跟MMAPv1不太一樣,一個集合一個檔案,一個索引一個檔案。所以你一共有多少集合,至少就會有集合數量x2個開啟檔案(以1集合檔案+1索引檔案計算)被佔用。再考慮到網路連接數量,要保證足夠大的open files值。open files可以通過以下命令修改:

ulimit -n 1024
  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.