简体   繁体   English

Amazon EC2上的Mongodb

[英]Mongodb on Amazon EC2

I don't know much about Mongodb and EC2. 我对Mongodb和EC2了解不多。 So as a layman, my question is how much I/O (in kb/mb/gb per second), a mongodb server can handle without choking, if mongodb server is installed on STANDARD SMALL EC2 LINUX/UBUNTU instance. 所以作为一个门外汉,我的问题是,如果mongodb服务器安装在STANDARD SMALL EC2 LINUX / UBUNTU实例上,那么mongodb服务器可以处理多少I / O(以kb / mb / gb /秒为单位),mongodb服务器可以处理而不会出现阻塞。

Is there any formula or software or website which can tell max strength or output of a server? 是否有任何公式或软件或网站可以告诉服务器的最大强度或输出?

NOTE: Mongodb and EC2 instances are installed in default mode. 注意:Mongodb和EC2实例以默认模式安装。

Thanks in advance 提前致谢

There isn't a specific formula for determining what you can run on a server, because this will vary greatly based on your server configuration and what your application (and server) is actually doing at the time. 没有用于确定可以在服务器上运行的内容的特定公式,因为这将根据您的服务器配置以及您的应用程序(和服务器)当时实际执行的操作而有很大差异。 There will also be an average load versus the peak load .. which could be considerably higher. 平均负载与峰值负载相比也可能相当高。

For example: 例如:

  • if your working data set is larger than available RAM your server may spend a lot of time shuffling files from disk to memory 如果您的工作数据集大于可用RAM,则服务器可能会花费大量时间将文件从磁盘转移到内存
  • if you are running a web server in the same instance as your database server .. the two will compete for available resource 如果您在与数据库服务器相同的实例中运行Web服务器,则两者将竞争可用资源
  • if you are doing a lot of data updates, your server will use more resource than the same number of reads 如果您正在进行大量数据更新,则您的服务器将使用比相同读取次数更多的资源
  • if you are searching without proper indexes, your database server will use more resource 如果在没有正确索引的情况下进行搜索,则数据库服务器将使用更多资源

For MongoDB, a helpful starting point would be the docs on Optimization . 对于MongoDB,一个有用的起点是关于优化的文档。

You should set up some proactive service for resource monitoring (eg. Munin ) to understand your application's usage patterns over time. 您应该为资源监控设置一些主动服务(例如Munin ),以了解您的应用程序的使用模式。

To work out a guesstimate for what your application can handle, you could also try to load test with one of the many benchmarking tools. 要计算出应用程序可以处理的内容,您还可以尝试使用众多基准测试工具之一加载测试 The key there is working out an accurate testing profile, and identifying potential performance hot spots/weaknesses to address. 关键在于制定准确的测试配置文件,并确定潜在的性能热点/弱点。

TL/DR: In our testing, an M1.Large utilizing EBS can handle (on average) about 250 non-sequential i/o operations per second. TL / DR:在我们的测试中,使用EBS的M1.Large可以处理(平均)每秒约250次非顺序I / O操作。 In sizing testing, this generally doesn't get above 20-30MB per second. 在测试测试中,这通常不会超过每秒20-30MB。 This is part of AWS's "high" IO setting. 这是AWS“高”IO设置的一部分。 For Smalls, they fall under "medium" IO, so to be safe, it would be about 1/2 to 2/3 of that output ... although in full disclosure, we have not done any testing on the smaller instances. 对于Smalls,它们属于“中等”IO,所以为了安全起见,它将是该输出的1/2到2/3 ......尽管在完全公开中,我们还没有对较小的实例进行任何测试。

Longer, more rambling answer ... 更长,更漫无边际的答案......

This is a complicated question because it ultimately depends on how large your active data set is and if it is significantly more than the 1.7GB of RAM associated with that instance. 这是一个复杂的问题,因为它最终取决于您的活动数据集的大小,以及它是否远远超过与该实例关联的1.7GB RAM。 The more data that does not fit into memory, the more that MongoDB will have to go to disk to get the data and the more that your app will be subject to waiting on the database as the database waits on (infamous) Amazon IO to return requested data to it. 不适合内存的数据越多,MongoDB必须转到磁盘才能获取数据,并且当数据库等待(臭名昭着)Amazon IO返回时,您的应用程序将在数据库上等待的次数越多要求提供数据。

Also, with MongoDB's lock, if you are more subject to slower IO (ie inserts and updates ... mainly updates), then contention could get you as well. 另外,使用MongoDB的锁定,如果你更容易受到较慢的IO(即插入和更新......主要是更新)的影响,那么争用也可以帮到你。

Also, if you don't want to worry about these issues and be able to scale around effectively, you could use one of the MongoDB hosting services (like MongoHQ ... disclaimer, I am a founder) as they allow you to scale effectively as you grow and allow you easier ways to test IO at different levels. 此外,如果您不想担心这些问题并能够有效扩展,您可以使用MongoDB托管服务之一(如MongoHQ ...免责声明,我是创始人),因为它们可以让您有效地扩展随着您的成长,您可以更轻松地在不同级别测试IO。

So, RAM and I/O performance are the important things to consider when choosing an instance. 因此,在选择实例时,RAM和I / O性能是需要考虑的重要事项。

本AWS白皮书可能有所帮助: http//media.amazonwebservices.com/AWS_NoSQL_MongoDB.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM