Adam Drake — Command-line Tools can be 235x Faster than your Hadoop Cluster
shelldata-engineeringhadoopperformanceunix-tools
Abstraction: Shell pipelines outperform Hadoop by 235x on single-machine data tasks
Key points:
- Processing 3.46GB of chess PGN files:
find | xargs -P4 mawk | mawkpipeline ran in ~12 seconds (~270 MB/sec) vs Hadoop cluster's ~26 minutes (~1.14 MB/sec) — 235x speedup - Shell pipes parallelize automatically; each command in a pipeline runs concurrently, providing free parallelism analogous to distributed stream processing Spouts/Bolts
- Parallelizing grep via
xargs -P4cut runtime from 65s to 38s; replacing grep+sort+uniq with awk reduced further; switching gawk to mawk reached the final 12s - Memory advantage: streaming analysis stores only 3 running integer counters vs loading all data into RAM
- Key insight: Hadoop and "Big Data" tools are often inappropriate for jobs that fit on one machine; traditional RDBMS or shell tools are frequently faster and cheaper
- mawk is often a drop-in replacement for gawk with better performance for simple record-processing
Connections: Adam Drake · Data Engineering · Stream Processing · Distributed Computing
Source: https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html