-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.5
-
Component/s: Performance, Write Ops
-
Query Execution
I have been doing some benchmarking ahead of the migration of our live system from 2.4.3 to 2.6.5. The first item for concern that my testing has highlighted is that there appears to have been a significant regression in performance in Mongo's ability to cope with multiple pushes of subdocuments.
My test scenario is as follows:
I have two identically configured servers in the same availability zone in AWS (of instance type m1.large). One is running 2.4.3 and the other is 2.6.5.
I have another larger box (hi1.4xlarge) in the same availability zone from which I execute the test first on one database, then the other.
The test involves making 100k updates with a push of a single small subdocument to the same collection and measuring the time it takes when pushing 20, 100, 1000, 5000, 10000 subdocs per doc. The collection has several indices including a unique index on a UUID field.
The test proceeds as follows:
empty the collection
generate appropriate number of UUIDs across which to spread 100k subdocs i.e. 100k / 20 = 5000 for the first test
make 100k updates (with upsert=True) as fast as possible and log time taken / database stats
From my scatter plot of results, it seems that the test runs fastest with 100 subdocs per doc (presumably because of the cost of updating the indices on the upsert of the larger number of documents dominates the time taken for the push with 20 subdocs per doc). Also it is clear that performance in 2.6.5 has been improved at this end of the scale.
However, as the number of pushes per document is increased, the performance of 2.6.5 degrades much faster than 2.4.3. I tried both Mongo versions with and without UsePowerOf2Sizes but found the effect of this parameter to be negligible (which was surprising having read the documentation on this feature). Are there any other parameters that affect the allocation of space that could be negatively affecting the performance of 2.6.5 in this test?
I attach scatter plot of timings, server stats from 2.4.3 and 2.6.5 when pushing 10k subdocs per doc and the python code used for testing (minus all the data logging stuff).