发布于 2015-09-14 15:10:23 | 131 次阅读 | 评论: 0 | 来源: 网络整理
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 is it somewhat analogous to tools such as bonnie++ (albeit mongoperf is simpler).
Specify options to mongoperf using a JavaScript document.
Displays the options to mongoperf. Specify options to mongoperf with a JSON document described in the Configuration Fields section.
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:
mongperf < config
In this example config is 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.
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.
Type: Integer.
Default: 1 megabyte (i.e. 10242 bytes)
Test file size.
Type: Integer.
Default: 0
mongoperf will pause for the number of specified sleepMicros divided by the nThreads between each operation.
Type: Boolean.
Default: false
Set mmf to true to use memory mapped files for the tests.
Generally:
Type: Integer.
Default: 0
Seconds between disk flushes. syncDelay is similar to syncDelay for mongod.
The syncDelay controls how frequently mongoperf performs an asynchronous disk flush the memory mapped file used for testing. By default, mongod performs 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 0 disables this
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:
Consider using iostat, as invoked in the following example to monitor I/O performance during the test.
iostat -xm 2