maximizing mongodb performance on aws
TRANSCRIPT
![Page 1: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/1.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Maximizing MongoDB Performance on AWS
![Page 2: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/2.jpg)
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.
![Page 3: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/3.jpg)
Storage
![Page 4: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/4.jpg)
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
![Page 5: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/5.jpg)
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
![Page 6: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/6.jpg)
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)
![Page 7: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/7.jpg)
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
![Page 8: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/8.jpg)
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
![Page 9: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/9.jpg)
Networking
![Page 10: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/10.jpg)
Networking Recommendations
• Amazon EC2 Enhanced Networking can provide significantly improved performance & consistency
![Page 11: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/11.jpg)
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
![Page 12: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/12.jpg)
Instance Size
![Page 13: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/13.jpg)
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
![Page 14: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/14.jpg)
Instance Size Recommendations
• One mongod process per instance to avoid processes competing for system resources
![Page 15: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/15.jpg)
Additional Recommendations
![Page 16: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/16.jpg)
Resilience
![Page 17: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/17.jpg)
Resilience
![Page 18: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/18.jpg)
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.
![Page 19: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/19.jpg)
Operations Burden
PATCHES
UPGRADES
SECURITY
BACKUPS
RECOVERY
99.999% UPTIME
UPSCALE
DOWNSCALE
PERFORMANCE
UAT
STAGING
MONITORING
ALERTS
PROVISION
CONFIGURE
INSTALL
![Page 20: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/20.jpg)
Automated Available On-Demand
Secure Highly Available Automated Backups
Elastically Scalable
Database as a Service for MongoDB
![Page 21: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/21.jpg)
![Page 22: Maximizing MongoDB Performance on AWS](https://reader034.vdocuments.us/reader034/viewer/2022050811/587064dd1a28ab48378b4bd7/html5/thumbnails/22.jpg)
Questions ?