... |
| In this default mode, mongoperf performs random 4KB +direct+ (physical) disk i/o's (i.e., O_DIRECT is used on Linux). Thus this is a physical disk i/o test. |
| * [Output form from an example run|https://gist.github.com/1694664] |
h3. mmf:true mode |
... |
mongoperf is a utility for checking disk i/o performance of a server independent of MongoDB. It performs simple timed random disk i/o's. The utility is new and will likely be more sophisticated in the future.
mongoperf can be used to check disk subsystem performance even when MongoDB will not be used at all: its mmf:false mode is completely generic. In that mode is it somewhat analogous to tools such as bonnie++ (albeit mongoperf is simpler).
Run scons mongoperf or scons mongoperf.exe to build. Note: mongoperf is new, so will need a recent version of the mongodb source code.
# show help: mongoperf -h # example invocation: # test physical (direct) random read io's, using 16 concurrent reader threads, # and a 1GB test file. echo "{nThreads:16,fileSizeMB:1000,r:true}" | ./mongoperf | tee out # we might do this while it runs: iostat -xm 2
In this default mode, mongoperf performs random 4KB direct (physical) disk i/o's (i.e., O_DIRECT is used on Linux). Thus this is a physical disk i/o test.
If mmf:true is specified as an option, tests are performed using memory-mapped files. These files are opened in a "normal" fashion and thus caching is allowed. This sometimes can be used to test file system cache behavior with memory mapped files.
{
nThreads:<n>, // number of threads (default 1)
fileSizeMB:<n>, // test file size (default 1MB)
sleepMicros:<n>, // pause for sleepMicros/nThreads between each operation (default 0)
mmf:<bool>, // if true do i/o's via memory mapped files (default false)
r:<bool>, // do reads (default false)
w:<bool>, // do writes (default false)
syncDelay:<n> // secs between fsyncs, like --syncdelay in mongod. (default 0/never)
}
| From: | MongoDB > MongoDB Ecosystem |
| To: | MongoDB > Old Pages |
| {toc} {redirect:http://docs.mongodb.org/manual/reference/mongoperf} |
| mongoperf is a utility for checking disk i/o performance of a server independent of MongoDB. It performs simple timed random disk i/o's. The utility is new and will likely be more sophisticated in the future. |
| mongoperf can be used to check disk subsystem performance even when MongoDB will not be used at all: its {{mmf:false}} mode is completely generic. In that mode is it somewhat analogous to tools such as bonnie+\+ (albeit mongoperf is simpler). h3. Prebuilt Binaries * Win32 24Jul2012 [mongoperf.exe|http://dl.dropbox.com/u/23907511/mongoperf.exe] * [Linux 64 bit|http://www.mongodb.org/download/attachments/30900544/mongoperf-linux64.gz] h3. Building |
Run {{scons mongoperf}} or {{scons mongoperf.exe}} to build. Note: mongoperf is new, so will need a recent version of the mongodb source code. |
| h3. Running {code}# show help: |
mongoperf -h # example invocation: # test physical (direct) random read io's, using 16 concurrent reader threads, # and a 1GB test file. echo "{nThreads:16,fileSizeMB:1000,r:true}" | ./mongoperf | tee out # we might do this while it runs: iostat -xm 2 |
| {code} h3. mmf:false mode (direct i/o test) |
In this default mode, mongoperf performs random 4KB +direct+ (physical) disk i/o's (i.e., O_DIRECT is used on Linux). Thus this is a physical disk i/o test. |
| * [Output from an example run|https://gist.github.com/1694664] h3. mmf:true mode If {{mmf:true}} is specified as an option, tests are performed using memory-mapped files. These files are opened in a "normal" fashion and thus _caching is allowed_. This sometimes can be used to test file system cache behavior with memory mapped files. h3. Additional Options {code} { |
nThreads:<n>, // number of threads (default 1) fileSizeMB:<n>, // test file size (default 1MB) sleepMicros:<n>, // pause for sleepMicros/nThreads between each operation (default 0) mmf:<bool>, // if true do i/o's via memory mapped files (default false) r:<bool>, // do reads (default false) w:<bool>, // do writes (default false) syncDelay:<n> // secs between fsyncs, like --syncdelay in mongod. (default 0/never) } |
| {code} * *nThreads* Number of test threads. You will need several threads to test a disk subsystem to saturation. For example, try {{nThreads:16}}. * *sleepMicros* Pause for sleepMicros/nThreads between each operation. * *r* Do read operations while testing. * *w* Do write options while testing. w and r may be used at the same time. * *syncDelay* For use with {{mmf:true}} mode only. The {{syncDelay:secs}} option instructs mongoperf to perform an asynchronous fsync of the test mmap file at the specified interval. mongod does something similar every 60 seconds, thus this can be useful to test basic system behavior in a simpler setting. This option is applicable only when using {{mmf:true}} mode. Currently in {{mongoperf}} this defaults to zero, which means off. * *fileSizeMB*. Specifies the size in megabytes of the test data file. The file will be placed in the current directory. *Specify a very large test file size to create a realistic simulation.* A very small file (1MB) could be cached by your disk controller completely. A file that is say, 100MB in size would involve a small number of disk cylinders, and adjacent track-to-track seeks [are much faster|https://gist.github.com/1694357] than a drive's average seek time. The file size is particularly important when {{mmf:true}} is specified, as the file system cache is then involved. A file size much larger than RAM will result in much different performance results than a file size smaller than RAM. h3. See Also * The utility is quite simple, so you might wish to also [take a look at the source code|https://github.com/mongodb/mongo/blob/master/src/mongo/client/examples/mongoperf.cpp]. * [iostat] |
| Redirection Notice This page should redirect to http://docs.mongodb.org/manual/reference/mongoperf. |