mongodb / mongo-perf

performance tools for mongodb
351 stars 140 forks source link

Results meaning #67

Closed airton-soares closed 5 years ago

airton-soares commented 5 years ago

Hello.

I'm just running tests in my database and tried to interpret the results. Basically there is two metrics: "total_ops" and "queries_latencies". The second one is pretty intuitive, but the first one not so much. What exactly is a operation that is being counted here? There are other metrics beside the ones I've mentioned?

henrikingo commented 5 years ago

Hi

I'm a bit unsure what you're referring to. Most tests should print output like this:

python benchrun.py --shell ../mongo -t 1 2 4 8 --trialCount 5 -f testcases/*.js --readCmd false --includeFilter insert  --includeFilter core regression --excludeFilter single_threaded --out perf.json --exclude-testbed --username admin --password password
...
mongoPerfRunTests([1, 2, 4, 8], 1, 1, 5, 5, [["insert"], ["core", "regression"]], [["single_threaded"]], 0, {"writeCmdMode": "true", "safeGLE": "false", "readCmdMode": "false", "writeConcern": {"j": "false"}}, true, false, {"traceOnly": false}, 'admin', 'password');
 Insert.SingleIndex.Seq
 1  8900.251744492538
 1  8919.514778396055
 1  8925.114396339317
 1  8922.15374855654
 1  8886.368122509246
 2  16500.339986400544
 2  16746.113409350215
 2  16532.765141818552
 2  16432.221112719257
....
 8  33362.57032777031

The output is the thread level and benchrun ops / second. It depends on the test what "ops" is.

airton-soares commented 5 years ago

Sorry, I didn't explain myself properly. I was investigating how this process work, how it obtain the results and what this results mean. Then found out that all the "magic" happens in the "util/utils.js" file. In this file, beggining at line 705, we can see that the results used are "ops_per_sec_values", "error_values" and "ops_per_sec", this are the values I am trying to figure it out what exactly mean. I found this file on the mongo github page, what aparently is the one that build the values used here. I don't know if this question still pertinent but if you have any idea of what this values mean will help me a lot.

henrikingo commented 5 years ago

Ah, I see. So everything in this repo is calling benchrun(), which is a stress test utility built into the mongo shell. The rationale really has been to be able to execute some simple benchmarks that loop in C++, as JavaScript of course isn't a proper language for benchmarking.

It is called here: https://github.com/mongodb/mongo-perf/blob/master/util/utils.js#L391

The documentation you're looking for is here: https://github.com/mongodb/mongo/wiki/JavaScript-Performance-Testing-Harness

airton-soares commented 5 years ago

Thank you man.