Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Suppose you're on dell.com right now and you're buying a server to run your MongoDB database for your small startup. You will have to handle literally tens of thousands of writes and reads per minute (but small objects). Would you go for 2 processors ? Invest more on RAM ?

I've heard (correct me if I'm wrong) MongoDB handles the most it can on the RAM and then flushes everything to the disk, in that case I should invest on a CPU with a large L2 cache, probably >40GB of RAM and a solid state drive.. right ?

Would I be better off with a high end (~$11,309, 2 expensive processors, 96GB of RAM) server or 2x(~$6,419, 2 expensive processors, 12GB of RAM) servers ?

Is Dell ok or do you have better sugestions ? (I'm outside the US, on Portugal)

share|improve this question

migrated from stackoverflow.com Feb 18 '11 at 23:05

This question came from our site for professional and enthusiast programmers.

3  
why are you purchasing hardware instead of going with something like EC2 for your startup? At least initially until you know what your requirements will be. –  Tom Schlick Feb 16 '11 at 21:25
    
Agree with Tom. Why not take some instances on the cloud? –  Rithish Feb 17 '11 at 13:34
1  
@mixdev, you're wrong: "Linux, NUMA and MongoDB tend not to work well together." source: mongodb.org/display/DOCS/NUMA –  Shadok Jun 6 '12 at 9:52

7 Answers 7

up vote 18 down vote accepted

Initially, you'll want to beef up on the RAM. The RAM you'll need is dependent on the amount of data you're storing, number of collections, indexes on those collections, data access patterns, etc. Lots of factors.

The most important thing is to have enough RAM to keep your indexes in RAM. Otherwise your performance will suffer dramatically as your server(s) will page constantly while Mongo moves memory mapped files in and out of RAM. In spite of all of this, we haven't seen write speed affected but everything else is. Processing writes off the queue, flushing, dumps, etc all take a dramatic hit once your indexes no longer fit in RAM.

So there is no real short answer. Basically, be smart about your indexes. Only use what you need. Keep collections small if you can (ie break out into multiple where you can.) Capped collections are also interesting to look into.

share|improve this answer
1  
In our experience, when Mongo is out of RAM for queries, not only does the query go to the docs (run forever, 5 mins, 15 mins, hour...), but inserts start to fail. –  samsmith Nov 28 '11 at 7:10

It is very important to use a 64 bit machine not 32 bit. http://blog.mongodb.org/post/137788967/32-bit-limitations

share|improve this answer

With MongoDB what you want is RAM. And then some more RAM. Buying RAM can't hurt.

share|improve this answer

If you're at the stage of buying production hardware then the application you're running must already be written, right? So run the app on hardware you have and take metrics. Gradually change some components and take more metrics. When you're done, you'll know which points of focus are most important for your application and scenario.

share|improve this answer

First - buy as much RAM as you can. Second limiting factor is disk speed. RAID helps. SSD helps. More shards help. Measure throughput comparing to disk efficiency and required response times, then decide what to do within the budget you have.

share|improve this answer

I would wonder if a Linux clustered solution would be a better, cheaper alternative.

MongoDB lets you distribute data over many servers. That will be impossible with one, honking server.

I thought MongoDB was one of the next steps taken after finding out that deploying a relational database on a honking server didn't scale well enough.

share|improve this answer

Tens of thousands write per minute is nothing. You can get 50.000 or more writes per second on decent hardware. Hardware specs really depends on what you are trying to do. In general enough RAM for large databases and a fast IO systems are important beside a decent CPU...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.