- Reference >
- MongoDB Package Components >
mongoperf
mongoperf¶
On this page
Synopsis¶
mongoperf is a utility to check disk I/O performance
independently of MongoDB.
It times tests of random disk I/O and presents the results. You can
use mongoperf for any case apart from MongoDB. The
mmf true mode is completely generic. In
that mode it is somewhat analogous to tools such as bonnie++ (albeit mongoperf is
simpler).
Specify options to mongoperf using a JavaScript document.
Options¶
-
mongoperf¶
-
--help¶ Displays the options to
mongoperf. Specify options tomongoperfwith a JSON document described in the Configuration Fields section.
-
<jsonconfig>¶ mongoperfaccepts configuration options in the form of a file that holds a JSON document. You must stream the content of this file intomongoperf, as in the following operation:In this example
configis the name of a file that holds a JSON document that resembles the following example:See the Configuration Fields section for documentation of each of these fields.
Configuration Fields¶
-
mongoperf.nThreads¶ Type: Integer.
Default: 1
Defines the number of threads
mongoperfwill use in the test. To saturate your system’s storage system you will need multiple threads. Consider settingnThreadsto16.
-
mongoperf.fileSizeMB¶ Type: Integer.
Default: 1 megabyte (i.e. 10242 bytes)
Test file size.
-
mongoperf.sleepMicros¶ Type: Integer.
Default: 0
mongoperfwill pause for the number of specifiedsleepMicrosdivided by thenThreadsbetween each operation.
-
mongoperf.mmf¶ Type: Boolean.
Default:
falseSet
mmftotrueto use memory mapped files for the tests.Generally:
- when
mmfisfalse,mongoperftests direct, physical, I/O, without caching. Use a large file size to test heavy random I/O load and to avoid I/O coalescing. - when
mmfistrue,mongoperfruns tests of the caching system, and can use normal file system cache. Usemmfin this mode to test file system cache behavior with memory mapped files.
- when
-
mongoperf.recSizeKB¶ New in version 2.4.
Type: Integer.
Default: 4 kb
The size of each write operation.
-
mongoperf.syncDelay¶ Type: Integer.
Default: 0
Seconds between disk flushes.
mongoperf.syncDelayis similar to--syncdelayformongod.The
syncDelaycontrols how frequentlymongoperfperforms an asynchronous disk flush of the memory mapped file used for testing. By default,mongodperforms this operation every 60 seconds. UsesyncDelayto test basic system performance of this type of operation.Only use
syncDelayin conjunction withmmfset totrue.The default value of
0disables this.
Use¶
Replace jsonconfigfile with the path to the mongoperf
configuration. You may also invoke mongoperf in the
following form:
In this operation:
mongoperftests direct physical random read io’s, using 16 concurrent reader threads.mongoperfuses a 1 gigabyte test file.
Consider using iostat, as invoked in the following example to
monitor I/O performance during the test.