SSDs, power loss protection and fsync latency
4 months ago
- #SSD
- #InnoDB
- #Performance
- Impact of fsync/fdatasync on SSDs without power loss protection (PLP): writes are fast but fsync is slow.
- InnoDB's behavior with O_DIRECT and O_DIRECT_NO_FSYNC: fsync frequency varies, with O_DIRECT_NO_FSYNC reducing fsync calls significantly.
- Consumer SSDs (e.g., Samsung 990 Pro) have higher fsync latency compared to enterprise SSDs (e.g., Crucial T500).
- Enterprise SSDs with PLP offer lower fsync latency, making them better for databases.
- Performance tests using fio show significant drops in write throughput when fsync/fdatasync is called per write.
- Google Cloud's Hyperdisk Balanced storage shows high fsync latency but good fdatasync performance.
- Hetzner's Intel D7-P5520 SSDs (enterprise) demonstrate low sync latency, ideal for database workloads.
- Samsung PM-9a3 (enterprise SSD) shows excellent sync latency for small writes but higher latency for large (2MB) writes.
- Recommendation: Use enterprise SSDs for databases; if not possible, test fsync/fdatasync latency on consumer SSDs.