This file tests that routing reads through a mongos does not impose an overhead greater than 30% (direct v passthrough and passthrough v sharded). That is, determine the penalty imposed by sharding.
Test
Compare the throughput of a fixed workload for various configurations.
The workload in this case consists solely of single reads (findOne).
The routes tested are:
- direct: bypass the mongos and send operations directly to a replica set primary.
- passthrough: route operations through a mongos to an unsharded collection.
- sharded: route operations through a mongos to a shard collection.
The pass / fail ratios are:
- passthrough / direct > 0.7
- sharded / passthrough > 0.7
Results are reported as the following ratios:
- passthrough / direct shard
- sharded / direct shard
Setup
non-mongos configuration versus the configuration behind a mongos and config server
Notes
- The collection namespace is mongos_read_single.test.
- The collection is sharded using a hashed shard key.
- This test uses a varying number of threads.
- The document being inserted is padded with a string of 'x's to ensure it is 512B in size.
- At the start of the test, a single document is inserted.
- The test is run for a fixed period of time, 3 minutes in this case.
Owning-team
mongodb/sharding
- Source:
Members
(inner) thread_levels
The number of threads to run in parallel. The default is [1, 16, 32].
The actual values in use are injected by run_workloads.py, which gets it from config file, see this hello world example.
- Source: