## In /etc/rc.local (Alternate) 

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 

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 . 

## Step 2: Apply the changes to /etc/rc.local as root 

source /etc/rc.local 

## Test Your Changes 

Whichever of the three methods you use, you can check the status of THP support by issuing the command: 

cat /sys/kernel/mm/transparent_hugepage/enabled 

or 

cat /sys/kernel/mm/redhat_transparent_hugepage/enabled 

on Red Hat Enterprise Linux, CentOS, and potentially other Red Hat-based derivatives. 

Correct output resembles: 

always madvise [never] 

## Use Database Commands 

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. 

See http://docs.mongodb.org/manual/reference/command for list of all commands sorted by func- tion. 

## Database Command Form 

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 } 

