Home >>MongoDB Tutorial >MongoDB Deployment
You should try to understand how your application can hold up in production while you are preparing a MongoDB deployment. It's a good idea to develop a consistent, repeatable approach to managing your deployment environment so that once you're in production, you can eliminate any surprises.
The best approach involves prototyping your set-up, carrying out load testing, monitoring key metrics, and using the information to scale your set-up. Proactively monitoring the whole system is the main part of the approach-this will help you understand how your production system will hold up until implementation, and decide where you will need to add capacity. For example , getting insight into possible spikes in your memory use could help put out a write-lock fire before it starts.
MongoDB offers some of the following commands to monitor your deployment –
This command checks the status of all running instances of Mongod and returns the database operations counters. Inserts, queries, updates, deletes, and cursors are included in these counters. When you touch page faults, Command also displays and shows your lock percentage. This means you run low on memory, hit write ability, or have any performance issues.
Start your instance of Mongod to execute the order. Go to the bin directory of your MongoDB installation in another command prompt, and type mongostat.
D:\set up\mongodb\bin>mongostat
This command tracks and reports, on a collection basis, the MongoDB instance's read and write operation. Mongotop returns information every second by default, which you can adjust accordingly. You should verify that your application purpose is matched by this read and write operation, and you do not shoot too many writes to the database at a time, read from a disk too much, or exceed your working set size.
Start your instance of Mongod to perform the order. Go to the bin directory of your MongoDB installation in another command prompt, and type mongotop.
D:\set up\mongodb\bin>mongotop
To modify the Mongotop command to return information less frequently, after the Mongotop command, define a particular number.
D:\set up\mongodb\bin>mongotop 30
Every 30 seconds, the above example will return values.
10gen provides a free, hosted monitoring service, MongoDB Management Service (MMS), which provides a dashboard and gives you a view of the metrics from your entire cluster, in comparison to the MongoDB tools.