Module: workloads/mongos_large_catalog_cache

This file tests the time it takes for mongos to route reads with a varying sized catalog.

Test

Compare the latency of a fixed workload for various catalog sizes.

The workload consists of creating a varying number of sharded collections. The insertion of the collection and chunk entries happens directly into config.collections for performance reasons. (findOne).

The scenarios tested are:

  1. fresh mongos: read through a mongos that has not yet seen any data.
  2. steady mongos: read from a collection through a mongos that has already seen this collection.
  3. new collection: read from a collection through a mongos that has not seen this collection, but that has already seen all other collections in this db.

Results are reported as the time in ms it takes to read in each scenario.

Setup

Requires a sharded cluster with two mongoses.

Notes

  • This test uses a different database each iteration.
  • This test inserts a varying number of entries into config.collections and config.chunks at the start of each iteration.
  • This test uses a different database each iteration. The overall amount of data on the config should not affect the time to read, only the amount for a particular database.

Owning-team

mongodb/sharding

Source:

Members

(inner) majorVersion

The major version of the server required to infer the FCV in use.

Source:

(inner) mongos_hosts

The mongos hosts assigned IP addresses. The expected format is a list of dictionaries containing a "private_ip" field. This parameter is used to connect through multiple mongoses in a sharded cluster. If left unassigned, the workload and listeners will connect to the default mongos. This test only runs on sharded clusters.

Source:

(inner) numCollectionsToCreate

The number of collections to "create" (insert directly into the catalog) before doing reads.

Source:

Methods

(inner) createCollectionAndChunkEntries()

Create an entry to be inserted in both config.collections and config.chunks for a given collection with one chunk. This mimics the catalog entries for a sharded collection.

Source:

(inner) createCollections()

Insert nCollections entires directly in config.collections and config.chunks. This mimics the entries created during shardCollection without actually calling it nCollections times, which would take too long when nCollections is very large. Do this over nThreads to speed up the time it takes to insert.

Source:

(inner) readOnShards()

Read from a collection on a given shard so that the shard has the collection entry in its cache. This way, when we read from mongos the shard will not have to refresh as well.

Source: