Rolling index builds are an alternative to the default index builds. Rolling indexes build indexes on the applicable nodes sequentially and may reduce the performance impact of an index build if your deployment matches one of the following cases:滚动索引构建是默认索引构建的替代方案。滚动索引按顺序在适用节点上构建索引,如果部署符合以下情况之一,则可以降低索引构建对性能的影响:
If your average CPU utilization exceeds (N-1)/N-10% where N is the number of CPU threads available to mongod如果平均CPU利用率超过(N-1)/N-10%,其中N是mongod可用的CPU线程数If the WiredTiger cache fill ratio regularly exceeds 90%如果WiredTiger缓存填充率经常超过90%
If your deployment does not meet this criteria, use the default index build.如果部署不符合此条件,请使用默认索引构建。
Warning
Avoid performing rolling index and replicated index build processes concurrently as it might lead to unexpected issues, such as broken builds and crash loops.避免同时执行滚动索引和复制索引构建过程,因为这可能会导致意外问题,如构建中断和崩溃循环。
Considerations注意事项
Rolling index builds hide at most one replica set member at a time, starting with the secondary members, and build the index on that member as a standalone.滚动索引构建一次最多隐藏一个副本集成员,从次要成员开始,并将该成员作为独立成员构建索引。Rolling index builds require at least one replica set election.滚动索引构建需要至少一个副本集选择。Rolling index builds lower the resiliency of your cluster and increases build duration.滚动索引构建会降低集群的弹性,并增加构建持续时间。
Note
For information about creating indexes in Atlas, refer to the index management page in the Atlas documentation.有关在Atlas中创建索引的信息,请参阅Atlas文档中的索引管理页面。
Tutorials教程
To create rolling index builds, use the following tutorials:要创建滚动索引构建,请使用以下教程: