Permalink
Fetching contributors…
Cannot retrieve contributors at this time
183 lines (112 sloc) 4.35 KB
.. _mongoperf:
=============
``mongoperf``
=============
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Synopsis
--------
:program:`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 :program:`mongoperf` for any case apart from MongoDB. The
:setting:`~mongoperf.mmf` ``true`` mode is completely generic. In
that mode it is somewhat analogous to tools such as `bonnie++
<http://sourceforge.net/projects/bonnie/>`_ (albeit mongoperf is
simpler).
Specify options to :program:`mongoperf` using a JavaScript document.
.. seealso::
* `bonnie <http://www.textuality.com/bonnie/>`_
* `bonnie++ <http://sourceforge.net/projects/bonnie/>`_
* `Output from an example run <https://gist.github.com/1694664>`_
.. _mongoperf-options:
Options
-------
.. binary:: mongoperf
.. program:: mongoperf
.. include:: /includes/option/option-mongoperf-help.rst
.. include:: /includes/option/option-mongoperf-<jsonconfig>.rst
.. _mongoperf-fields:
Configuration Fields
--------------------
.. setting:: mongoperf.nThreads
*Type:* Integer.
*Default:* 1
Defines the number of threads :program:`mongoperf` will use in the
test. To saturate your system's storage system you will need
multiple threads. Consider setting :setting:`~mongoperf.nThreads` to ``16``.
.. setting:: mongoperf.fileSizeMB
*Type:* Integer.
*Default:* 1 megabyte (i.e. 1024\ :sup:`2` bytes)
Test file size.
.. setting:: mongoperf.sleepMicros
*Type:* Integer.
*Default:* 0
:program:`mongoperf` will pause for the number of specified
:setting:`~mongoperf.sleepMicros` divided by the
:setting:`~mongoperf.nThreads` between each operation.
.. setting:: mongoperf.mmf
*Type:* Boolean.
*Default:* ``false``
Set :setting:`~mongoperf.mmf` to ``true`` to use memory mapped
files for the tests.
Generally:
- when :setting:`~mongoperf.mmf` is ``false``, :program:`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 :setting:`~mongoperf.mmf` is ``true``, :program:`mongoperf`
runs tests of the caching system, and can use normal file system
cache. Use :setting:`~mongoperf.mmf` in this mode to test file system cache
behavior with memory mapped files.
.. setting:: mongoperf.r
*Type:* Boolean.
*Default:* ``false``
Set :setting:`~mongoperf.r` to ``true`` to perform reads as part of
the tests.
Either :setting:`~mongoperf.r` or :setting:`~mongoperf.w` must be ``true``.
.. setting:: mongoperf.w
*Type:* Boolean.
*Default:* ``false``
Set :setting:`~mongoperf.w` to ``true`` to perform writes as part of
the tests.
Either :setting:`~mongoperf.r` or :setting:`~mongoperf.w` must be ``true``.
.. setting:: mongoperf.recSizeKB
.. versionadded:: 2.4
*Type:* Integer.
*Default:* 4 kb
The size of each write operation.
.. setting:: mongoperf.syncDelay
*Type:* Integer.
*Default:* 0
Seconds between disk flushes. :setting:`mongoperf.syncDelay` is
similar to :option:`--syncdelay <mongod --syncdelay>` for :program:`mongod`.
The :setting:`~mongoperf.syncDelay` controls how frequently
:program:`mongoperf` performs an asynchronous disk flush of the memory
mapped file used for testing. By default, :program:`mongod`
performs this operation every 60 seconds. Use
:setting:`~mongoperf.syncDelay` to test basic system performance of
this type of operation.
Only use :setting:`~mongoperf.syncDelay` in conjunction with
:setting:`~mongoperf.mmf` set to ``true``.
The default value of ``0`` disables this.
Use
---
.. code-block:: javascript
mongoperf < jsonconfigfile
Replace ``jsonconfigfile`` with the path to the :program:`mongoperf`
configuration. You may also invoke :program:`mongoperf` in the
following form:
.. code-block:: sh
echo "{nThreads:16,fileSizeMB:10000,r:true,w:true}" | mongoperf
In this operation:
- :program:`mongoperf` tests direct physical random read and write io's, using
16 concurrent reader threads.
- :program:`mongoperf` uses a 10 gigabyte test file.
Consider using ``iostat``, as invoked in the following example to
monitor I/O performance during the test.
.. code-block:: sh
iostat -xtm 1