High Performance MongoDB Clusters with Amazon EBS Provisioned IOPS
High Performance MongoDB Clusters with
Amazon EBS Provisioned IOPS
Jafar Shameem
Business Development Manager, Amazon Web Services
Sandeep Parikh
Solutions Architect, 10gen
Miles Ward
Solutions Architect, Amazon Web Services
Charity Majors
Engineer, Parse
Agenda
• AWS Storage Options and EBS
• Introducing Provisioned IOPS
• About MongoDB
• MongoDB on AWS best practices
• How Parse runs MongoDB on AWS and benefits from Provisioned IOPS
Storage Options on AWS
Block Storage Object Storage
(Elastic Block Store) (S3, Glacier)
Use for: Use for:
• Access to raw • Pictures, videos,
unformatted block highly durable
level storage media storage
• Persistent Storage • Cold storage for
long-term archive
Amazon Elastic Block Store (EBS)
Elastic Block Storage: Persistent Storage for EC2
Feature Details
High Mount EBS as drives and
performance format as required
file system
Flexible size Volumes from 1GB to 1TB in
size
Secure Private to your instances
Available Replicated within an
High performance block storage Availability Zone
device Backups Volumes can be snapshotted
Mount as drives to instances for point in time restore
Persistent and independent of
Monitoring Detailed metrics captured via
instance lifecycle Cloud Watch
Introducing Provisioned IOPS Volumes
❶ Select a new type of Provisioned IOPS volumes
❷ Specify the volume capacity
❸ Specify the number of IOs per second your
application needs, up to 2000 PIOPS per
volume. The volume will deliver the specified
IO per second.
$ ec2-create-volume --size 500 --availability-zone us-east-1b --type io1 –iops 2000
When should I use Provisioned IOPS?
• Standard volumes are designed for boot volumes, running
applications with moderate and bursty IO, sequential IO access
• Provisioned IOPS volumes are
designed for running transactional
applications that require high and
consistent IO:
o Relational Databases
o NoSQL Databases, e.g. MongoDB
o Productivity applications, e.g.
Microsoft Exchange
o Enterprise Applications
MongoDB Basics
• Open source
• Document database
• High performance
• Horizontally scalable
• Fully featured
• Built to match agile development and
deployment
MongoDB Features
• Flexible document data model
• Rich ad-hoc queries
• Real-time aggregation
• Support for geospatial data and queries
• Built-in scalability
– Redundancy, failover and auto-partitioning
• Broad programming language support
Mapping MongoDB to AWS
• MongoDB scales easily across multiple nodes
• High memory and fast storage
• Durability and performance
• Deploy across multiple data centers
• Quickly add capacity
High Performance Workloads
• Instances support up to 240+ GiB memory
• Provisioned IOPS provides consistent and
predictable EBS performance
• RAID10 maximizes performance and durability
• EBS snapshots integrate with MongoDB
– Fast and easy backup
– Quickly restore and deploy additional nodes
MongoDB on AWS Resources
• Best practices for configuring MongoDB
• MongoDB on AWS white paper
• Sample CloudFormation templates to launch
– Single node deployments
– Pre-configured multi-node replica sets
Stability Tips
• Ext4 or XFS
• Reduce I/O overhead –
• nodiratime, noatime
• Raise file descriptor limits
• Set disk read-ahead
• No large virtual memory pages
• SNAPSHOT SNAPSHOT SNAPSHOT
Parse runs on AWS
• We provide a platform for mobile developers
• SDKs and APIs for iOS, Android, Windows
mobile apps -- 60,000 and counting
• Highly elastic traffic patterns
• As a platform, we can’t go down, so cloud
computing is the only way to go
Why we use MongoDB
• Mongo is not optimized for one task, it’s very
good across a broad range of tasks
• Schema-less is a must
• We can do auto-indexing based on an analysis
of your traffic and data
• Horizontal scalability
• Reliability across multiple Availability Zones
The ways we use MongoDB
• User data
• RAID 0 striped P-IOPS 1000 EBS volumes
• smart indexing, EC2 snapshots, continuous compaction on
snapshot nodes
• sharded in the application layer
• Common data
• Real-time query analysis
• ephemeral storage for disposable data
• Billing and logging
Things we’ve learned
• Always use replica sets. Spread across AZs.
• Chef everything so nodes are disposable
• Warm up your secondaries before promoting.
• Snapshot often. Never allow your snapshot
host to become primary
• set priority=0, also hidden=true if you read off secondaries
• Use Provisioned IOPS and ebs_optimized if
you care about your data
In summary
• We love MongoDB. The rate of development
and improvement is incredible.
• PIOPS made it feasible for us to stay on AWS
• Parse wouldn’t be possible without both the
elasticity and power of AWS and the
functionality of MongoDB
Get started on Provisioned IOPS
today!
aws.amazon.com/ebs
Questions: e-mail: shameemj@amazon.com
• MongoDB CloudFormation Templates:
o http://docs.mongodb.org/ecosystem/tutorial/automate-deployment-with-cloudformation/
• MongoDB on AWS:
o http://docs.mongodb.org/ecosystem/platforms/#amazon-web-services-ec2
• Slides will be made available here:
o http://aws.amazon.com/ebs/webinars/
• Benchmarking EBS performance:
o http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html
Editor's Notes
We will post these slides on the EBS website soon.