为我的 mongodb 服务器设置推荐多少 RAM 和硬盘

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9064167/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 12:27:26  来源:igfitidea点击:

How much RAM and Hard Disc is recommended for my mongodb server setup

mongodb

提问by Uday

I have the below scenario for an alert notification application, for which we are going to use mongodb.

我有以下警报通知应用程序的场景,我们将使用 mongodb。

Number of writes per day 20Mill

每天写入次数 20Mill

Data size of 1month data 150 GB

1个月数据大小 150 GB

index(default primary index) size of 1 month data 15 GB

index(默认主索引) 1个月数据大小 15 GB

I want to keep the data of 12 months. How much RAM and Hard Disc is recommended for my application. I will add the additional memory that need to accomodate the working set.

我想保留12个月的数据。为我的应用程序推荐多少 RAM 和硬盘。我将添加需要容纳工作集的额外内存。

回答by Bill

The physical memory used by mongodb depends on the data being accessed. MongoDB only loads into physical memory data that is "touched"/required. Else even though the entire database is memory mapped it is not loaded into RAM (virtual memory vs resident memory). The actual RAM used is determined by the number of OS pages required for the data/index that you use based on queries/commands etc..

mongodb 使用的物理内存取决于被访问的数据。MongoDB 仅加载到“接触”/需要的物理内存数据中。否则,即使整个数据库是内存映射的,它也不会加载到 RAM 中(虚拟内存与常驻内存)。实际使用的 RAM 取决于您根据查询/命令等使用的数据/索引所需的操作系统页面数。

The following link has some information on this:

以下链接提供了一些关于此的信息:

http://www.mongodb.org/display/DOCS/Checking+Server+Memory+Usage

http://www.mongodb.org/display/DOCS/Checking+Server+Memory+Usage

If you are going to be storing approximately 165g per month and need to retain that data for a 12 month period, then you are looking at the need for at least 2tb, possibly more especially if the numbers are growing beyond what is stated above.

如果您打算每月存储大约 165 克,并且需要将这些数据保留 12 个月,那么您需要考虑至少 2 TB 的需求,尤其是在数字增长超出上述范围的情况下。