Mongodb – Deciding EC2 Instance type & Volume IOPS for Mongo DB

amazon ec2awsmongodbperformance

We have 500GB data in our Mongo(v2.6.3) including the indexes.

We currently run this on AWS m3.large(8GB RAM) instance. Yes, Single
machine.

Our MongoDB Cloud Manager shows these stats:

Opcounters – 1.5k
Background Flush Average – 5s
Non mapped Virtual Memory – 2GB
Lock Percentage – 15%
BTree – 6k
Connections – 2k
Queues – 100
Record Stats – 200
Page Faults – 1k

Our Mongo has become slower over the last few months as the Data is growing rapidly at the rate of 40GB per month.

We are sure this is the time to scale it up. We had difficult time deciding whether to scale it horizontally or vertically. What we decided then was that let's scale vertically now. And six months down the line, as we will have more bandwidth in terms of people(currently we are a very small team), we will scale it Horizontally. We would love to have your views on this decision.

And moreover, the biggest confusion that we have is over choosing hardware.The options we have are:

AWS Ec2 r3.large - 2 CPU Cores - 15GB RAM
AWS Ec2 r3.xlarge - 4 CPU Cores - 30GB RAM

And we will be taking 1.5TB Volume but still confused with the number of IOPS that we need to reserve.

Hoping to get your views & valuable suggestions.

Best Answer

You should be able to view your current IOPS on the monitoring page of AWS - at least you can for RDS instances.

If this is EC2 and not RDS (RDS is backed by EC2 instances) you probably need to enable enhanced monitoring for those instances.