Simpanoz
Simpanoz

Reputation: 2859

Mongodb on Amazon EC2

I don't know much about Mongodb and 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.

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.

Thanks in advance

Upvotes: 3

Views: 3306

Answers (3)

Sajee
Sajee

Reputation: 4447

This AWS whitepaper may help: http://media.amazonwebservices.com/AWS_NoSQL_MongoDB.pdf

Upvotes: 1

Stennie
Stennie

Reputation: 65333

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
  • if you are running a web server in the same instance as your database server .. the two will compete for available resource
  • 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.

You should set up some proactive service for resource monitoring (eg. Munin) to understand your application's usage patterns over time.

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.

Upvotes: 5

Jason McCay
Jason McCay

Reputation: 3345

TL/DR: In our testing, an M1.Large utilizing EBS can handle (on average) about 250 non-sequential i/o operations per second. In sizing testing, this generally doesn't get above 20-30MB per second. This is part of AWS's "high" IO setting. 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.

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. 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.

Also, with MongoDB's lock, if you are more subject to slower IO (i.e. inserts and updates ... mainly updates), then contention could get you as well.

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.

So, RAM and I/O performance are the important things to consider when choosing an instance.

Upvotes: 3

Related Questions