This guide helps you choose the right starting configuration for your 本指南帮助您为mongot部署选择正确的启动配置。按照以下步骤确定有效的启动配置,并根据特定需求对其进行优化。mongot deployment. Follow these steps to determine an effective starting configuration and refine it for your specific needs.
Get Started开始使用
Identify your primary workload class确定主要工作量类别
First, determine whether your application fits into the High-CPU or Low-CPU workload class. This is the most important factor in selecting the right resources.首先,确定应用程序是适合高CPU还是低CPU工作负载类。这是选择合适资源的最重要因素。
High-CPU WorkloadsCPU工作负载高Choose this class for general-purpose full-text search where query performance is critical and CPU-intensive. These nodes typically have a 2:1 RAM-to-CPU ratio.对于查询性能至关重要且CPU密集的通用全文搜索,请选择此类。这些节点通常具有2:1的RAM与CPU比率。Low-CPU Workloads低CPU工作负载This class is ideal for vector search applications, especially with low data volumes, where memory is prioritized over raw CPU power. These nodes usually have an 8:1 RAM-to-CPU ratio.此类非常适合矢量搜索应用程序,特别是在数据量较低的情况下,内存优先于原始CPU功率。这些节点通常具有8:1的RAM与CPU比率。
Tip
If you want to get started quickly or have a general use case, a small or medium High-CPU node is typically a balanced and effective starting point.如果你想快速开始或有一个通用用例,中小型高CPU节点通常是一个平衡且有效的起点。
Select a starting size选择起始尺寸
After you identify your workload class, use the following table to find a recommended starting CPU size based on your primary scaling dimension. These recommendations are a starting point. Adjust your CPU size based on your actual workload patterns.确定工作负载类后,使用下表根据主要扩展维度找到推荐的起始CPU大小。这些建议是一个起点。根据实际工作负载模式调整CPU大小。
| High-CPU | |||
| Low CPU | <= 10GB of vectors 10GB - 50GB of vectors >= 50GB of vectors | Small Medium Large | |
| High CPU | 20 - 40 QPS, light indexing 80 - 160 QPS 320 - 480 QPS, heavy indexing | Small Medium Large |
For example, if you expect to handle 100 queries per second (QPS) for a full-text search application, a Medium High-CPU node is a suitable choice.例如,如果您希望全文搜索应用程序每秒处理100个查询(QPS),那么中高CPU节点是一个合适的选择。
Disk Sizing Guideline磁盘大小指南
Due to index mapping, a collection's size and the resulting search index's size are not always correlated. For example, if your documents have 100 fields but your search index is configured for only 5 of those fields, the index will be much smaller than the collection. 由于索引映射,集合的大小和结果搜索索引的大小并不总是相关的。例如,如果文档有100个字段,但搜索索引仅配置了其中的5个字段,则索引将比集合小得多。Conversely, mapping all fields or using features like autocomplete can increase index size.相反,映射所有字段或使用自动补全等功能会增加索引大小。
Estimate Index Size估计指标大小
To estimate the total index size based on your collection size, perform these steps:要根据集合大小估计总索引大小,请执行以下步骤:
Insert 1-2 GB of data or create a small collection using插入1-2GB的数据或使用$out.$out创建一个小集合。Create a search index with your chosen field mappings.使用您选择的字段映射创建搜索索引。Observe the resulting index size and index-to-collection size ratio. If you already use Atlas Search, you can find the index size in cluster metrics or on the index list page.观察得到的索引大小和索引与集合大小的比率。如果您已经使用Atlas Search,则可以在集群指标或索引列表页面上找到索引大小。
Use the index-to-collection size ratio to estimate the total index size based on your expected collection size. For example, if a 1GB collection yields a 250MB index (a 0.25:1 ratio), a 12GB collection would likely result in an approximately 3GB index.根据预期的集合大小,使用索引与集合大小的比率来估计总索引大小。例如,如果1GB的集合产生250MB的索引(比率为0.25:1),则12GB的集合可能会产生大约3GB的索引。
Refine, deploy, and monitor优化、部署和监控
Sizing is an iterative process. After you deploy your initial configuration, monitor its performance and adjust accordingly.规模是一个迭代过程。部署初始配置后,监视其性能并相应地进行调整。
Refine your estimate优化估算: Before deploying, review the Resource Allocation considerations. Carefully monitor factors that can impact resource needs, such as your indexing strategy (for example, nGram tokenization) or query complexity.:部署前,请查看资源分配注意事项。仔细监控可能影响资源需求的因素,例如索引策略(例如nGram标记化)或查询复杂性。For disk sizing, remember that index size is not directly correlated to collection size.对于磁盘大小,请记住索引大小与集合大小没有直接关系。- Deploy
: For a production-ready application, using dedicated Search Nodes is highly recommended to ensure resource isolation and high availability.:对于生产就绪的应用程序,强烈建议使用专用的搜索节点,以确保资源隔离和高可用性。 Monitor key metrics监控关键指标: After launch, monitor performance to see if you need to scale up or down. For example::启动后,监控性能,看看是否需要放大或缩小。例如:- CPU
: If CPU usage is consistently above 80%, you likely need to scale up.:如果CPU使用率始终高于80%,您可能需要扩大规模。 Memory内存: If:如果搜索页面故障始终超过每秒1000次,则系统需要更多内存。要衡量搜索页面故障,请使用Search Page Faultsare consistently over 1000 per second, your system needs more memory. To measure Search Page Faults, use themongot_system_process_majorPageFaults_operationsmetric.mongot_system_process_majorPageFaults_operations指标。Disk:磁盘:Ensure you have enough free disk space to handle index rebuilds. Generally you should allocate double the disk space your index requires. This extra space allows indexes to be rebuilt when needed.确保您有足够的可用磁盘空间来处理索引重建。通常,您应该分配索引所需的两倍磁盘空间。这个额外的空间允许在需要时重建索引。当磁盘利用率达到90%时,mongotbecomes read-only when disk utilization reaches 90%.mongot变为只读。
- CPU