问题
According to this MongoDB tutorial which explains how to manually deploy MongoDB on EC2, one of the steps states that you should have:
"Individual PIOPS EBS volumes for data (1000 IOPS), journal (250 IOPS), and log (100 IOPS)."
Why do I need individual EBS volumes for journal, log, and data? Can I just combine these into one EBS volume?
回答1:
MongoDB team may have experienced that IOPS needs for data is highest, log is the lowest and journal is somewhere in the middle. Although I am less familiar with MongoDB, I suspect that some of the reasons why they might be suggesting different EBS volumes include:
- cost saving: provision right amount of IOPS based on needs will save $. If it was all on a single partition, you'd use maximum IOPS of 1000 and end up paying more
- snapshot: you could snapshot data at a different (more frequent?) interval
- contention: data, journaling and logging will not contend with each other if they are on different volumes
- scaling: you could scale data volume separately from journal and log volumes
- risk reduction: if data volume has troubles you could restore from backup and reapply journal (I assume you can), and analyze at logs too
回答2:
The reason for separating your deployment storage across 3 volumes is that database journal files and log files are sequential in nature, and as such, have different access patterns compared to data files. Separating data files from journal and/or log files, particularly with a write intensive workload, will provide an increase in performance by reducing I/O contention. Depending on your workload, and if you are experiencing high I/O wait times, you may be able to benefit from separate disks for your data files, journal, and log files.
The answer was taken from https://www.mongodb.com/blog/post/maximizing-mongodb-performance-on-aws
来源:https://stackoverflow.com/questions/30905369/on-ec2-why-do-i-need-individual-ebs-volumes-for-journal-log-and-data