HDFS Storage Overhead and Erasure Coding Trade-offs
0 reputation · 15 Nov 2020, 20:16 UTC
0 reputation · 15 Nov 2020, 20:16 UTC
Reducing infrastructure costs for low-traffic Hadoop workloads often involves transitioning from traditional 3x replication to Erasure Coding (EC) to minimize physical storage footprints.
While EC significantly reduces the storage overhead, it introduces a higher CPU burden during the recovery of lost blocks and during initial write operations. In environments with limited compute resources, this shift can create a performance bottleneck that offsets the cost benefits of reduced disk usage.
For a cluster running on Hadoop 3.x, what is the recommended balance between the EC policy and CPU allocation to ensure data availability without degrading write performance? Additionally, how does the recovery latency of EC compare to standard replication when operating on low-density hardware?
The recommended balance for low-traffic workloads is to implement a 4+2 Erasure Coding (EC) policy. This reduces storage overhead from 200% (3x replication) to approximately 50%, while maintaining tolerance for two node failures. To prevent write performance degradation, you should allocate at least 1.5 to 2 virtual CPU cores per DataNode specifically for handling the parity calculations required during initial writes.
Recovery latency in EC is significantly higher than standard replication on low-density hardware. In a replicated environment, recovery is a simple network copy from a healthy node. In EC, recovering a lost block requires reading multiple data and parity blocks, performing XOR calculations to reconstruct the missing data, and writing it to a new location. On hardware with limited compute, this CPU-intensive reconstruction process can create a bottleneck, often resulting in recovery times that are 2x to 3x slower than simple replication.
hdfs dfs -setStoragePolicy -type ec-rs-4-2 /path/to/cold/data
dfs.datanode.ec.threads to align with your available CPU cycles to prevent the encoding tasks from starving other cluster services.dfs.datanode.ec.encode.time and dfs.datanode.ec.recovery.time during testing.This analysis assumes the cluster is running Hadoop 3.0 or higher, where EC is a native feature. The specific performance impact varies heavily based on the network bandwidth; if your network is saturated, the CPU overhead of EC may be less noticeable than the increased internal traffic required for reconstruction. We are uncertain whether your specific hardware has IOPS limits, which could further throttle the EC reconstruction speed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.