Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/baseprime/mongobench

MongoDB Benchmarking
https://github.com/baseprime/mongobench

Last synced: 11 days ago
JSON representation

MongoDB Benchmarking

Awesome Lists containing this project

README

        

mongobench
===========

A benchmarking tool for MongoDB. The tool performs both read and write tests (using insert() and find()). Test data is generated by the tool based on the number of 'str_cnt' defined i.e. 1 ... n UUID string elements are created depending on the 'str_cnt' defined. The tool will measure the time taken for each read / write operation and provide statistics upon completion (including both average query time and queries per second).

The number of documents to be written and read can also be defined (in the 'documents' variable) as well as the number of concurrent connections that should be created by the process. Currently all options need to be defined within the script.

Sample output:
```
WRITE TEST RESULTS (insert):
Number of documents: 1024
Concurrency: 64
Number of benchmarks: 1
Average connection & query time: 0.0249066145625
Average QPS: 2408.99861559
READ TEST RESULTS (find):
Number of documents: 1024
Concurrency: 64
Number of benchmarks: 1
Average connection & query time: 0.00104909064248
Average QPS: 57192.3888846
```

The variables that need to be configured are:
```
database = 'mongobench' # The database to be used for benchmarking
collection = 'testcollection' # The default collection prefix name
documents = 100000 # The number of documents to be written and read
benchmarks = 1 # The number of iterations for each type of benchmark (Read / Write)
concurrency = 128 # The number of concurrent connections to be opened
min_id = 0 # The minimum value for the range of docset_ids generated
max_id = documents # 500 The maximum value for the range of docset_ids generated (when set to the 'documents' value find() executed during read tests will always return 1 document - decrease in order for find() to return multiple documents)
connstr = "mongodb://localhost:28017/" # The default connection string - username and password can be added
str_cnt = 1 # number of UUID string elements in document (increasing this value will increase document size)
```