maximizing mongodb performance on aws
TRANSCRIPT
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Maximizing MongoDB Performance on AWS
Approaches to running your MongoDB deployment in AWS
• Manage everything yourself. Things to consider:
• Storage/Disk• Networking• Instance Size (Memory &
CPU)
• Rely on a “MongoDB” service with best practices built in.
Storage
Storage Recommendations
• Databases require fast storage
• Amazon EBS: persistent block level storage to associate with Amazon EC2 instances
• Instance store: storage volumes that directly attach to Amazon EC2 hardware for temporary storage
Storage Recommendations
• We recommend Amazon EBS for Amazon EC2 for MongoDB
• Configured IOPS (PIOPS) for IOPS guarantee
• Amazon EBS-optimized instance types (C4, M4, D2, etc) provide dedicated throughput between Amazon EC2 & Amazon EBS
• Improves performance by minimizing contention from other traffic to your instances with regards to Amazon EBS I/O traffic
Storage Recommendations
• We recommend dedicating 3 separate volumes for MongoDB, each with their own IOPS due to differing workloads. For example:
• /data (1000 IOPS)• /journal (250 IOPS)• /log (100 IOPS)
Storage Recommendations
• Consider throughput for storage performance
• AWS is fairly generous • Of this writing, the maximums for AWS
throughput are:• Max. throughput/Volume is 320 MiB/s• Max. throughput/Instance is 800 MiB/s• For better throughput, shard
Storage Recommendations
• RAID 10 provides data reliability by mirroring data on secondary drives (RAID 1) and stripes data across drives (RAID 0)
• Ensure that your total throughput of the combined RAIDed volumes does not exceed the maximum instance throughput
Networking
Networking Recommendations
• Amazon EC2 Enhanced Networking can provide significantly improved performance & consistency
Networking Recommendations
• Configure Amazon VPCs for MongoDB. Amazon Virtual Private Cloud allows you to provision a private, isolated section in AWS where you can define your own IP address, subnets, route tables, and gateways.
• Use Managed NAT Gateway service
Instance Size
Instance Size Recommendations
• Err on the side of going larger and scaling down as needed.
• MongoDB working set should fit in memory
• M4, I2, and R3 Amazon EC2 instance types tend to be most successful and widely deployed in customer deployments
Instance Size Recommendations
• One mongod process per instance to avoid processes competing for system resources
Additional Recommendations
Resilience
Resilience
Approaches to running your MongoDB deployment in AWS
• Manage everything yourself. Things to consider:
• Storage/Disk• Networking• Instance Size (Memory &
CPU)
• Rely on a “MongoDB” service with best practices built in.
Operations Burden
PATCHES
UPGRADES
SECURITY
BACKUPS
RECOVERY
99.999% UPTIME
UPSCALE
DOWNSCALE
PERFORMANCE
UAT
STAGING
MONITORING
ALERTS
PROVISION
CONFIGURE
INSTALL
Automated Available On-Demand
Secure Highly Available Automated Backups
Elastically Scalable
Database as a Service for MongoDB
Questions ?