Mongodb start today when, until not noticed, today found another warning, want the whole a whole.
The following is a warning
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten]
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten]
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten]
2019-09-05T12:00:55.271+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 15012 processes, 102400 files. Number of processes should be at least 51200 : 0.5 times number of files.
Then we solved one by one:
transparent_hugepage ,
The above two problems can be solved together:
echo never >/sys/kernel/mm/transparent_hugepage/enabled
echo never>/sys/kernel/mm/transparent_hugepage/defrag
soft rlimits too low
The problem is that we can not simply put ulimit -n number of open file handles that, while improving the user may have to use the number of threads
There are several solutions, introduced here a relatively quick and timely entry into force:
/Etc/security/limits.conf modify files, added at the end:
* soft noproc 65535
* hard noproc 65535
And then perform step ulimit -u 65535
- The first step is a permanent process
- The second step is the immediate entry into force of the current session process