Module: workloads/mongos_50read_50write

This file tests that routing operations 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. This workload alternates single reads (findOne) and writes (insert).

The routes tested are:

  1. direct: bypass the mongos and send operations directly to a replica set primary.
  2. pass through: route operations through a mongos to an unsharded collection.
  3. sharded: route operations through a mongos to a shard collection.

The pass / fail ratios are:

  1. passthrough / direct > 0.7
  2. sharded / direct > 0.7

Results are reported as the following ratios:

  1. passthrough / direct
  2. sharded / direct

Setup

non-mongos configuration versus the configuration behind a mongos and config server

Notes

  • The collection namespace is mongos_50read_50write.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.
  • 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: