mongoperf1
Mongodb
Usage
mongoperf is
a
utility
to
check
disk
I/O
performance
independently
of
MongoDB.
Options
mongoperf
-
--help -
Displays the options to mongoperf. Specify options to mongoperf with a JSON document described in the Configuration Fields section.
<jsonconfig>-
mongoperf accepts configuration options in the form of a file that holds a JSON document. You must stream the content of this file into mongoperf, as in the following operation:
mongoperf < configIn this example
configis the name of a file that holds a JSON document that resembles the following example:{nThreads:<n>,fileSizeMB:<n>,sleepMicros:<n>,mmf:<bool>,r:<bool>,w:<bool>,recSizeKB:<n>,syncDelay:<n>}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 mongoperf will use in the test. To saturate your system's storage system you will need multiple threads. Consider setting nThreads to
16.
mongoperf.fileSizeMB-
Type: Integer.
Default: 1 megabyte (i.e. 10242 bytes)
Test file size.
mongoperf.sleepMicros-
Type: Integer.
Default: 0
mongoperf will pause for the number of specified sleepMicros divided by the nThreads between each operation.
mongoperf.mmf-
Type: Boolean.
Default:
falseSet mmf to
trueto use memory mapped files for the tests.Generally:
- •
-
when mmf is
false, mongoperf tests 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 mmf is
true, mongoperf runs 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.
mongoperf.r-
Type: Boolean.
Default:
falseSet r to
trueto perform reads as part of the tests.Either r or w must be
true.
mongoperf.w-
Type: Boolean.
Default:
falseSet w to
trueto perform writes as part of the tests.Either r or w must be
true.
mongoperf.syncDelay-
Type: Integer.
Default: 0
Seconds between disk flushes. syncDelay is similar to
syncDelayformongod.The syncDelay controls how frequently mongoperf performs an asynchronous disk flush the memory mapped file used for testing. By default,
mongodperforms this operation every every 60 seconds. Use syncDelay to test basic system performance of this type of operation.Only use syncDelay in conjunction with mmf set to
true.The default value of
0disables this
Use
mongoperf < jsonconfigfile
Replace jsonconfigfile with the path to the mongoperf configuration. You may also invoke mongoperf in the following form:
echo "{nThreads:16,fileSizeMB:1000,r:true}" | ./mongoperf
In this operation:
- •
-
mongoperf tests direct physical random read io's, using 16 concurrent reader threads.
- •
-
mongoperf uses a 1 gigabyte test file.
Consider using iostat, as invoked in the following example to monitor I/O performance during the test.
iostat -xm 2