johnlpage / POCDriver

Workload Driver for MongoDB in Java
Other
204 stars 87 forks source link

Questions regarding CLI arguments #24

Closed keltik85 closed 6 years ago

keltik85 commented 6 years ago

Thanks for creating this Tool.

I have a few questions regarding its CLI arguments/parameters:

  1. What exactly does the parameter -i 50 do in this case? What is meant by -i,--inserts Ratio of insert operations (default 100) ? What does ratio mean in a more elaborate fashion?
java -jar POCDriver.jar -d 120 -i 50 -l 20 -f 40  -c 
mongodb://admin:admin@192.168.178.201/myLoadTestDatabase?authSource=admin
  1. I would like to insert 100 Documents, update and read them. Additionally I want to read 50 other documents in parallel to the first operation. Which combination of CLI arguments would be appropriate for that case?

  2. What exactly does the parameter -r 3 do in this case?

    java -jar POCDriver.jar -d 120 -v iuk -r 3 -l 20 -f 50 -x 5 -c 
    mongodb://admin:admin@192.168.178.201/myLoadTestDatabase?authSource=admin

    I guess that the above command should do the following:

    • -v iuk => insert, update and fetch a record as many times as possible per second
    • -r 3, do additional range queries on the data which has been inserted

My problem is that, the POCDriver does not do any range queries at all, see output:

MongoDB Proof Of Concept - Load Generator
Worker thread 0 Started.
Worker thread 1 Started.
Worker thread 2 Started.
Worker thread 3 Started.
------------------------
After 12 seconds, 171 new records inserted - collection has 14705 in total 
14 inserts per second since last report 0.00 % in under 50 milliseconds
55 keyqueries per second since last report 98.66 % in under 50 milliseconds
56 updates per second since last report 75.29 % in under 50 milliseconds
0 rangequeries per second since last report 100.00 % in under 50 milliseconds

------------------------
After 22 seconds, 1197 new records inserted - collection has 15731 in total 
102 inserts per second since last report 0.00 % in under 50 milliseconds
81 keyqueries per second since last report 97.91 % in under 50 milliseconds
82 updates per second since last report 21.24 % in under 50 milliseconds
0 rangequeries per second since last report 100.00 % in under 50 milliseconds

What did I do wrong or didn't understand correctly?

I hope I could formulate my problem in a understandable manner and you can answer the questions.

Best regards.

niccottrell commented 6 years ago

Looking at the code, I'll try and answer your questions.

  1. By default POCDriver will just insert documents 100% of the time and no do any reads or updates. If you specify other basic operations, they will be run in proportion. For example if you specify -i 10 -k 20 -r 5 -u 15 the total operations is 10+20+5+15 = 50. So for 10/50=20% of the time, POCDriver will do inserts.

  2. You can't really specify different operations per thread. Each thread will loop through doing as many operations as possible - but following the same pattern you specify via basic operations or the -v workflow option. Note that each thread will only read its own documents - i.e. the ones that it inserted.

  3. The -r would normally trigger a range query, but since you specified -v the workflow is run instead. I've just updated the README to make this clearer.

  4. So if you remove the -v you should see range queries starting to happen.

Does this answer everything?

keltik85 commented 6 years ago

Thank you for the accurate response.