MongoDB Documentation, Release 3.0.4 In /etc/rc.local (Alternate) Step 2: Apply the changes to /etc/rc.local as root Test Your Changes Use Database Commands Database Command Form 223 5.2. Administration Tutorials You specify a command first by constructing a standard BSON document whose first key is the name of the command. For example, specify the isMaster command using the following BSON document: { isMaster: 1 } See http://docs.mongodb.org/manual/reference/command for list of all commands sorted by func- tion. The MongoDB command interface provides access to all non CRUD database operations. Fetching server stats, initializing a replica set, and running a map-reduce job are all accomplished with commands. always madvise [never] Correct output resembles: on Red Hat Enterprise Linux, CentOS, and potentially other Red Hat-based derivatives. cat /sys/kernel/mm/redhat_transparent_hugepage/enabled or cat /sys/kernel/mm/transparent_hugepage/enabled Whichever of the three methods you use, you can check the status of THP support by issuing the command: These lines should immediately precede exit 0 , which should already be the last line in the file. Note that on Red Hat Enterprise Linux, CentOS, and potentially other Red Hat-based derivatives, transparent_hugepage in the paths in the script should be replaced by redhat_transparent_hugepages . source /etc/rc.local Step 1: Edit /etc/rc.local /etc/rc.local is a user-configurable script that is run at the end of post-boot system initialization. Add the following script lines to the file as root to disable THP upon each boot. if test -f /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; then echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi