Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In this final section, I outline a heuristic for diagnosing and resolving performance issues.
Most of the performance issues in MongoDB deployments can be traced to a single source: the hard disk. In essence, the more pressure placed on the disk, the slower MongoDB runs. Thus the goal of most performance optimizations is to reduce reliance on disk. There are several ways to accomplish this, but before we look at them, it’s useful to know how to ascertain disk performance in the first place. On Unix derivatives, the iostat tool is ideal for this. In the following example, I use the -x option to show extended statistics, and you specify 2 to display those stats at two-second intervals:[10]
[10] Note that this example is Linux-specific. On Mac OS X, the command is iostat -w 2.