Problem Description:
Mac OSX environment through the TCP test tool, create 3,000 connections, reported too many open files specific error: ' 2016-05-11t00:59:29.772+0800 E STORAGE [Thread1] Wiredti GER [1462899569:771906][60793:0x70000020a000], Log-server:/data/db/journal:opendir:too many open files in system2 016-05-11t00:59:29.772+0800 E STORAGE [Thread1] Wiredtiger (23°c) [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 [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 (All) [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 Excepti On "filenotopen:failed to open interim file/data/db/diagnostic.data/metrics.interim.temp ' in full-time diagnostic dat A capture subsystem. Shutting downThe full-time diagnostic data capture subsystem.2016-05-11t00:59:33.566+0800 E STORAGE [thread2] Wiredtiger (23) [1462899 573: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 m UST 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]
`
Reply content:
Problem Description:
Mac OSX environment through the TCP test tool, create 3,000 connections, reported too many open files specific error: ' 2016-05-11t00:59:29.772+0800 E STORAGE [Thread1] Wiredti GER [1462899569:771906][60793:0x70000020a000], Log-server:/data/db/journal:opendir:too many open files in system2 016-05-11t00:59:29.772+0800 E STORAGE [Thread1] Wiredtiger (23°c) [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 [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 (All) [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 Excepti On "filenotopen:failed to open interim file/data/db/diagnostic.data/metrics.interim.temp ' in full-time diagnostic dat A capture subsystem. Shutting downThe full-time diagnostic data capture subsystem.2016-05-11t00:59:33.566+0800 E STORAGE [thread2] Wiredtiger (23) [1462899 573: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 m UST 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]
`
You can check how many open files are allowed first
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
Actually mongoshell , you'll be prompted this when you get in.
2016-05-11t17:45:17.536+0800 I CONTROL [initandlisten] * * warning:soft rlimits too low. Number of files is a, should be at least 1000
WiredTigerWorks in a different way, a collection of one MMAPv1 file, one index of a file. So how many collections do you have, at least there will be a collection of X2 open files (calculated as 1 collection File +1 index file) are occupied. Take into account the number of network connections, to ensure large enough open files values. Open files can be modified with the following command:
ulimit -n 1024