Navigation

Performance Considerations

Atlas Search runs a new process, called mongot, alongside the mongod process on each host in your Atlas cluster. mongot maintains all Atlas Search indexes on collections in your Atlas databases. The amount of CPU, memory, and disk resources mongot consumes depends on several factors, including your index configuration and the complexity of your queries.

Atlas Search is deployed on your Atlas cluster. When a new version of Atlas Search is deployed, your Atlas cluster might experience brief network failures in returning query results. To mitigate issues during deployment and minimize impact to your application, consider the following:

To learn more about the changes in each release, see Atlas Search Changelog.

When you create an Atlas Search index, the default configuration sets field mapping to dynamic, which means that all the data in your collection is actively added to your Atlas Search index. Other options such as enabling highlights can also result in your index taking up more disk space. You can reduce the size and performance footprint of your Atlas Search index by:

  • Specifying a custom index definition to narrow the amount and type of data that is indexed.
  • Setting the store option to false when specifying a string type in an index definition.

Creating an Atlas Search index is resource-intensive. The performance of your Atlas cluster may be impacted while the index builds.

If you change the configuration of an Atlas Search index it must rebuild, which also consumes resources and may affect database performance.

Note

Do not run queries against an Atlas Search index while it is building. Ensure that all nodes in your cluster have the Active status before running Atlas Search queries.

You can scale up your initial sync and steady state indexing for an Atlas Search index by upgrading your cluster to a higher tier with more cores. Atlas Search uses a percentage of all available cores to run both initial sync and steady state indexing and performance improves as new cores are made available by upgrading your cluster.

The complexity level of Atlas Search queries and the type of operators used can affect database performance. Highly complex queries with multiple clauses are resource-intensive, as are queries which use the regex (regular expression) operator.

Atlas Search queries are ranked by score. Queries that return a large number of results are more computationally intensive because they must keep track of all the scores for the result set.

You can monitor your Atlas cluster and view charts with performance statistics on the Atlas Metrics tab. These metrics can help you see how Atlas Search queries and index building affect your cluster's performance.

Note

If your cluster's resources are stretched or near the limits of acceptable performance, consider upgrading to a larger cluster tier before implementing Atlas Search functionality.

Using a $match aggregation pipeline stage after a $search stage can drastically slow down query results. If possible, design your $search query so that all necessary filtering occurs in the $search stage to remove the need for a $match stage. The $compound Atlas Search operator is helpful for queries that require multiple filtering operations.

Using a $sort aggregation pipeline stage after a $search stage can drastically slow down query results. If possible, design your $search query so that all necessary sorting occurs in the $search stage to remove the need for a $sort stage. In general, the Atlas Search $compound operator is helpful for queries that require multiple sorting operations. To sort documents based on a numeric, date, or geo field, consider using the Atlas Search $near operator.

Give Feedback