Database Reference
In-Depth Information
"mapped" : 320,
"mappedWithJournal" : 640
},
"ttl" : {
"deletedDocuments" : NumberLong(0),
"passes" : NumberLong(0)
}
},
"ok" : 1
}
As you can see, serverStatus outputs quite a lot of detail and the above is the truncated! You can find the two
most important sections of the information returned by this function in the opcounters and asserts sections.
The opcounters section shows the number of operations of each type that have been performed against the
database server. You should have a good idea about what constitutes a normal balance for these counters for your
particular application. If these counters start to move out of the normal ratio, then it may be an early warning that
your application has a problem.
For example, the profile illustrated has an extremely high ratio of inserts to reads. This could be normal for a
logging application; however, for a blogging application, it could indicate that either a spambot was hitting your
“comments” section or a URL pattern that caused writes to the database was being repeatedly crawled by a search
engine spider. In this case, it would be time to either put a captcha on your comments form or to block the particular
URL pattern in your robots.tx file .
The asserts section shows the number of server and client exceptions or warnings that have been thrown. If
such exceptions or warnings start to rise rapidly, then it's time to take a good look through your server's logfiles to see
whether a problem is developing. A high number of asserts may also indicate a problem with the data in the database,
and you should review your MongoDB instance's logfile to confirm the nature of these asserts and if they indicate
normal “user asserts,” which represent things like duplicate key violations, or more pressing issues.
Shutting Down a Server
If you have installed your MongoDB server from a package, you can use the operating system's service management
scripts to shut down the server. For example, Ubuntu, Fedora, CentOS, and RedHat let you shut down the server by
issuing the following command:
$sudo service mongod stop
You can also shut down the server from the mongo console:
$mongo
>use admin
>db.shutdownServer()
You can use the Posix process management commands to terminate a server, or you can use the
SIG_TERM(-15) or SIG_INT(-2) signal to shut down the server.
If—and only if—the server fails to respond to those two methods, you can use the following command:
$sudo killall -15 mongod
 
Search WWH ::




Custom Search