MongoDB Linux performance optimization: https://docs.mongodb.com/manual/administration/production-notes/#allocate-sufficient-ram-and-cpu
Performance optimization:
1. Close the Atime storage volume that contains the database files.
2, according to the recommendations in the Ulimit reference, the file descriptor limit,-n User process limit (ulimit) set to-u20,000 above, a low ulimit will affect MongoDB in a lot of use, may produce errors, causing the connection MongoDB process failure and service failure.
3, disable transparent pages. MongoDB behaves better on the normal (4096 bytes) virtual memory page. See transparent Page Setup. ,
4, disable NUMA in the BIOS. If this is not possible, see MongoDB on NUMA hardware.
5, a problem has been reported when using SELinux-enabled MongoDB. To avoid problems, disable SELinux as much as possible.
6, using the Wiredtiger storage engine, it is highly recommended to use XFS to avoid performance issues that may occur when using EXT4 with Wiredtiger
7, disable HTTP interface
Operation mode:
1,cat/sys/kernel/mm/transparent_hugepage/enabled to see if it starts
When viewed with a command, if the output is [always] means transparent large pages are enabled. [Never] indicates transparent large page disable, [madvise]
https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/shutdown mode
2,vm.zone_reclaim_mode = 0
Configure Vm.zone_reclaim_mode = 0 To make the remote memory allocation take precedence over swap out local page
http://blog.csdn.net/shaochenshuo/article/details/53410094
3, use Noatime for DBPath mount point
After the file system properties in the/etc/fstab are added noatime, then mount-oremount/will be effective immediately.
4,sysctl-w vm.zone_reclaim_mode=0
This article is from the "Wang Xiao Acid" blog, please be sure to keep this source http://wangaimin.blog.51cto.com/8499946/1959833
MongoDB Performance Optimization