MongoDB, like most database systems, prefers to handle memory allocation itself rather than relying on the underlying kernel's memory handling processes. To run MongoDB efficiently, the kernel parameter transparent_hugepages and transparent_hugepages/defrag should be set to 'never'.
To complicate matters slightly, since CentOS 6, a service named tuned runs by default and sets various kernel parameters periodically. To keep our custom configurations, we'll create a new tuned profile and have it override the OS supplied defaults.
Setting tuned Parameters