Mongodb performance optimization
Mongodb linux performance optimization:
Official documents:
Https://docs.mongodb.com/manual/administration/production-notes/#allocate-sufficient-ram-and-cpu
Performance optimization:
1. Close the storage volume where the atime contains the database files.
2. According to the recommendation in ulimit reference, set the file descriptor limit,-n user process limit (ulimit) to more than-u20000. a low ulimit will affect the heavy use of MongoDB and may cause errors, resulting in connection MongoDB process failure and service failure.
3. Disable transparent pages. MongoDB performs better on normal (4096-byte) virtual memory pages. See transparent page setup.
4, disable NUMA in BIOS. "if not, refer to MongoDB on NUMA hardware."
5. When using MongoDB with SELinux enabled, the problem has been reported. To avoid problems, disable SELinux whenever possible.
6. Using the WiredTiger storage engine, it is strongly recommended to use XFS to avoid performance problems that may occur when using EXT4 with WiredTiger
7, disable the http interface
Mode of operation:
1Cat / sys/kernel/mm/transparent_hugepage/enabled to see if it is started.
When viewing with the command, if the output is [always], the transparent large page is enabled. [never] indicates that transparent large pages are disabled, and [madvise] indicates that
Https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/ shutdown mode
2meme vm.zonecircle reinvented recording mode = 0
Configure vm.zone_reclaim_mode = 0 so that de-remote memory allocation takes precedence over swap out local page when memory is insufficient
Http://blog.csdn.net/shaochenshuo/article/details/53410094
3, use noatime for dbPath mount point
Add noatime to the attributes of the file system in / etc/fstab, and then use mount-oremount / to take effect immediately.
4 vm.zone_reclaim_mode=0 sysctl-w