2015 05-09 deploy mongodb replicaset in aws
TRANSCRIPT
Aftership’s Mongodb Replicain AWS
- The replica architect design
- Tricks for best C/P
- Optimization in OS & Query
- House Keeping
- 1M shipments (Jan 2014)
- 12M shipments (Jan 2015)
- 100M shipments (Est. Jan 2016)
- API uptime over 99.99%
StatsNumber of shipments tracked
- Lots of instance types
c3, m1, m2, m3, r3, i2, d2, from micro to 8xlarge
- High availability: multi-zones
- Easy backup: Snapshot
Why Amazon
Our Replica Set
replication replication
Primaryzone A
i2.2xlarge
Secondaryzone C
r3.2xlarge
Secondaryzone C
i2.2xlarge
Our Replica Set
replication replication
Primaryzone A
Secondaryzone C
Secondaryzone B
i2.2xlarge
r3.2xlargei2.2xlarge
2 x 800 SSD
1024GB EBS2 x 800 SSD
Tricks for best C/P
- Mix Instance Types
- Primary: SSD Instance storage
- Secondary: PIOPS SSD EBS
http://goo.gl/1FWDbb
http://goo.gl/HNfPfy
Tricks for best C/P
- Saving by using Instance StorageUSD388 x 2 x 12 month = USD9,312
- Saving by mixing instance typesUSD6237 – 3253 = USD2,984
- Save yearly USD12,296
Optimization in OSReadAhead
https://comerford.cc/tag/readahead/
- Provisioned IOPS works with an IO request size of 16KB
- 16KB = 1.0 OP, 32KB = 2.0 OP, etc
- Using .hint() in query
- Using Index Filter Ignore .hint() in query
Do not persist after instance shutdown
Optimization in Query.hint()
- Specify max time limit in ms for processing operations in server side
Optimization in Query.maxTimeMS()
House Keeping/log
logrotate
https://goo.gl/WuncmN