- Test case 2
- How we tested
RESTHeart has been designed and developed with lightness and performances as fundamental parameters. On this regards, also thanks to its caching capabilities, RESTHeart often overcomes the results that can be achieved accessing MongoDB directly via its Java driver.
This section includes the performance test results gathered by the SoftInstigate’s development team and includes all the information needed to autonomously reproduce the tests.
Test case 1
Measure the execution time to create 1 million documents with random data, using 200 test threads.
In this scenario, RESTHeart introduces just a 2,41% overhead over the total execution time:
Test case 2
Measure the execution time to query a collection 100.000 times, getting 5 documents each time (limit 5) and skipping just 25 documents, under different concurrency levels.
RESTHeart delivers better performances under any concurrency level over direct access via MongoDB driver:
Test case 3
Measure the execution time to query a collection 2.000 times, getting 5 documents each time (limit 5) and skipping just 250.000 documents, under different concurrency levels.
Thanks to the eager pre-allocation DBCursor engine, queries with significant skip parameter executes much faster (50 times in this case) with RESTHeart:
Test case 4
Measure the execution time to query a collection 500 times, getting 5 documents each time (limit 5) skipping more and more documents each time, with a concurrency level of 4.
Thanks to the eager pre-allocation DBCursor engine, queries with significant skip parameter executes much faster (up to 470 times in this scenario) with RESTHeart.
(Kskips = 1000 skip)
How we tested
MongoDB and RESTHeart running on Sunfire X2200 M2 with 2 CPU with 16 Gbyte of RAM. See full specification here. This is an old server with 2 dual core 2,2GHz AMD Opteron CPUs.
Test cases run by MacBook Pro client with 2,66 GHz Intel Core i7 and 8 GB 1067 MHz DDR3
The client and the server on the same local network linked by a 10/100 Ethernet switch.
- Server OS: Ubuntu server 64bit 14.04.1 LTS
- Client OS: Mac OS X Yosemite 10.10.1
- MongoDB: 2.6.7
- RESTHeart: commit 01d403a5db8b765ad5b0a8eec1fda420c392ab58
MongoDB: run (without authentication enabled) with the following command
$numactl --interleave=all /opt/mongodb/bin/mongod --fork --syslog
RESTHeart: run with default parameters with the following exception:
- logging to file off
- eager-cursor-allocation-linear-slice-heights set to 
- io-threads: 8
- worker-threads: 64
We used the brilliant load test tool.
The test case code is available on Github as part of the RESTHeart source code baseline. You can find it here.