For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Test Cluster Load Shedding

If your cluster receives more incoming operations than its resources can process, your cluster experiences overload. Overload can cause a total or near-total outage on your cluster.

Intelligent Workload Management (IWM) helps Atlas keep clusters usable during overload. Load Shedding is a setting that controls the IWM behaviors that reject operations during prolonged overload. When Load Shedding is on, Atlas can reject operations. To configure Load Shedding for your cluster, see the cluster additional settings.

Important

The Load Shedding setting doesn't control all IWM activity on your cluster. If you disable Load Shedding on your cluster, Atlas continues to run other supported IWM behaviors that do not reject operations. To learn more, see Intelligent Workload Management.

You can run a Load Shedding test to validate that your drivers, observability setup, and operational workflow are ready before you rely on active protection in production.

During the test, Atlas turns on Load Shedding for the duration that you select, then returns the setting to its earlier value. While Load Shedding is active, Atlas rejects a small percent of operations, selected at random, regardless of the load on your cluster.

Run the test to checker whether your drivers and applications handle overload errors without passing failures to your users. For driver compatibility with Load Shedding, see Handle Overload Errors from Load Shedding.

Note

Random rejection of a small percent of operations happens only during Load Shedding tests. When you enable Load Shedding outside of a test, Atlas rejects operations only when the cluster is overloaded.

To run an Load Shedding test, you must have Project Cluster Manager access to the project.

Ensure that your Atlas cluster meets the following requirements:

  • The cluster is an M30 or larger replica set running MongoDB 9.0 or later.

  • The cluster has no pending changes. Any changes that you make to the cluster configuration must finish deploying before you start the test.

  • The cluster isn't already running an Load Shedding test. You can run only one Load Shedding test on a cluster at a time.

Consider the following before you start the test:

  • When Atlas rejects operations during the test, your application can receive overload errors. To learn more about these errors, see Handle Overload Errors from Load Shedding.

  • Run the test on a test or development cluster, not on a production cluster. Drivers and applications that don't handle overload errors can surface failures to your users.

1
  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. In the sidebar, click Clusters under the Database heading.

The Clusters page displays.

2
  1. For the cluster you want to test, click the icon.

  2. Click Test Resilience.

  3. Select Load Shedding.

3
  1. From the Test Duration dropdown, select a duration. You can choose 15 minutes (recommended), 1 hour, 8 hours, or 1 day. Atlas ends the test when the selected time elapses, or you can stop the tests at any point before then.

  2. To confirm the test, type the name of the cluster in the confirmation field.

  3. Click Begin Load Shedding.

4

While the test runs, Atlas rejects a small percent of operations, selected at random.

In the Atlas UI metrics view, review the Operation Throttling chart to see how many operations Atlas rejects to relieve pressure. To learn more, see Review Available Metrics.

To stop the test before the selected duration elapses, click End Test Now.

5

While the test runs, Atlas displays an Load Shedding Test in Progress banner at the top of the cluster. The banner shows the time the test ends and links to the Metrics view.

6

After the test ends, Atlas shows the number of operations rejected during the test and whether your cluster's Load Shedding intervention metrics changed as expected.

If your drivers' compatibility with Load Shedding is unknown, mixed, or includes an unsupported version, Atlas recommends that you upgrade your drivers. To learn more, see Handle Overload Errors from Load Shedding.