4

We're testing deployment of a web app on Amazon's EC2 which uses MongoDB for the database. Mongo recommends using at least 3 nodes for replication for data integrity. Although this is testing, we'd like to test with replication to see how the system handles failures, so we need 3 EC2 instances at a minimum. I'd also like to see that web load balancing works as well.

My thinking is to create 3 medium EC2 instances all running both MongoDB and the web server. We'll have a load balancer distribute web requests between the three servers, and configure Mongo to use them as replicas for data integrity.

Are there any problems with this plan?

user32381
  • 207
  • 3
  • 8

2 Answers2

4

Since this is a "testing" phase, ans we all know that testing is the model we use for production, I'd remind you that MongoDB is memory-heavy, and uses filesystem cache to map files.

If your web application is also memory-heavy, and there is not enough memory for your application AND MongoDB to run, then MongoDB will be the one that suffers, since the kernel will evict FS cache due to requests for private/resident pages in memory.

As long as you are keeping an eye on your memory usage pattern (including kernel-level buffers/caches, and mongod page faults), you should be fine.

Mike Fiedler
  • 2,162
  • 1
  • 17
  • 34
0

no seems fine for testing failover of mongo and replicasets.

Mike
  • 22,310
  • 7
  • 56
  • 79