“How many servers should we buy?”
Kabir's internship has moved to a payments startup. Its UPI switch writes about 2 TB of transaction logs a day, the regulator wants three years kept, and the fraud reports must be ready by 6 AM. The CFO wants one number by Friday: how many servers. Kabir's first guess comes from the lab: “Our three containers wrote 210 MB/s, so…” Riya stops him.
Kabir, those 210 MB/s came from three containers sharing one laptop disk. A real server has twelve disks and its own network card. You can't multiply a laptop.
Then where do I even start?
From the data, not from the hardware. How much arrives each day, how small it gets on disk, how long you keep it, how many copies. That gives the storage, and storage usually decides the server count. Then you check three things against it: can the nightly work finish in its window, can the NameNode hold all the file and block objects, and does the network keep up. Today we do the whole calculation and also benchmark our own lab properly, so you know what a benchmark number really means.
Cluster sizing
Cluster sizing (capacity planning) is the process of estimating the hardware a cluster needs to meet its storage, processing, availability and growth requirements. For Hadoop it combines: storage = data ingested per period × compression ratio × retention × replication factor (or erasure-coding overhead), plus space for temporary and intermediate data and headroom to keep disks below a target fill level; compute = the number of concurrent containers needed so that the workload, expressed in container-seconds, completes within its time window; memory and CPU per node derived from container sizes after reserving resources for the operating system and daemons; NameNode heap estimated from the expected number of files, directories and blocks; network bandwidth for ingest, replication and shuffle; and the master and edge nodes required for high availability and access. Estimates rest on stated assumptions and on benchmarks (such as TestDFSIO) of representative hardware.
Work out how much data you will keep and how much work you must finish in how much time, add safety margins, and turn that into servers. Write down every assumption, and measure real hardware before trusting a number.
Words you'll meet in this lesson
From our lab (TestDFSIO, 64 MB files, replication 3, 3 workers on one laptop)
| Write | 1 task: 113.48 MB/s · 3 tasks: 61.82 MB/s each (about 185 in total) · 6 tasks: 34.99 MB/s each (about 210 in total) |
|---|---|
| Read | 1 task: 320 MB/s · 3 tasks: 175.34 MB/s each · 6 tasks: 130.3 MB/s each (files just written, so mostly from memory) |
| Why it flattens | All three workers are containers on one laptop with one disk: more writers share the same disk |
| Example cluster | 2 TB/day, 3 years, replication 3 → 3,812.9 TB of disk → 40 workers; with cold data on RS-6-3 → 22 workers |
Architecture at a glance: the cluster we are sizing
The UPI example, sized. Typical hardware values (disks, RAM, NICs) are assumptions for illustration.
Sizing at three levels
Beginner Building a godown
- A grain trader asks: how big a godown? You ask how many sacks arrive a day, how long they stay, and whether every sack must be stored three times (copies) in different corners.
- You never fill a godown to the roof: you need aisles and space for a sudden delivery (headroom and temp space).
- Then you check the loading crew: can they move tonight's sacks before morning? That is compute against the batch window.
Intermediate The calculation, in order
- Storage: 2 TB × 0.25 = 0.5 TB/day → × 1,095 = 547.5 TB → × 3 = 1,642.5 TB → × 1.25 ÷ 0.70 × 1.3 = 3,812.9 TB → ÷ 96 = 40 workers.
- NameNode: 2,048 files of 256 MB a day → 2,242,560 files and 4,485,120 blocks in 3 years → about 0.9 GB of objects at 150 B each. Plan a heap several times larger.
- Compute: 60 TB scanned nightly at 20 MB/s per container = 3,145,728 container-seconds ÷ 10,800 s = 291 containers, against 40 × 30 = 1,200.
- Per node: 256 GB − 32 GB reserved = 224 GB for YARN; 30 vcores → about 7.5 GB per vcore (Lesson 11.4).
Advanced What experienced planners add
- Tiering: keep 90 hot days with 3 copies and older data in erasure coding: 888.8 TB of data and 22 workers instead of 40 (Lesson 7.3).
- Network: 20 workers × 10 Gb = 200 Gb against 80 Gb of uplink is 2.5:1 oversubscription; replication and shuffle cross racks, so keep it modest.
- Failure budget: losing one 96 TB node means re-replicating up to 96 TB; headroom and network decide how long that takes.
- Benchmark, then re-plan: run TestDFSIO and a real job on one candidate server, replace the assumed throughput, and review against actual growth every quarter.
Exam tip: For “How will you size a Hadoop cluster for X TB per day?”, write the storage formula (daily × ratio × retention × replication × temp ÷ fill × growth ÷ disk per node), then one line each for compute (container-seconds ÷ window), NameNode heap (objects × ~150 B) and masters (2 NN, 3 JN, 3 ZK, 2 RM).
The levers that change a sizing
| Lever | Example change | Effect in our example | Cost |
|---|---|---|---|
| File format | Raw CSV → Parquet + zstd | 159 → 40 workers | Conversion jobs (Lesson 10.2) |
| Retention | 3 years → 1 year | 40 → 14 workers | A policy decision, often regulatory |
| Erasure coding | Cold data (90+ days) on RS-6-3 | 40 → 22 workers | Slower recovery, more CPU (Lesson 7.3) |
| File size | 1 MB → 256 MB files | NameNode objects ÷ about 170 | Compaction or batching (Lesson 7.5) |
| Disk fill target | 70% → 85% | Fewer disks, less safety | Risk during failures and rebalancing |
Roles to size
Workers
DataNode + NodeManager. Sized by storage first, then checked for compute.
manyMasters
2 NameNodes, 3 JournalNodes, 3 ZooKeeper, 2 ResourceManagers, JobHistory: usually 3 servers with lots of RAM, spread over racks.
3–5Edge nodes
Where users and tools (Airflow, Hive clients, ingest) connect; no data stored.
2+Network
10/25 GbE per server, top-of-rack switches, uplinks; watch oversubscription.
racksAnimated example: sizing the payments cluster
- Compress: 2 TB of raw logs a day becomes about 0.5 TB as Parquet with zstd (an assumption based on Lesson 10.2).
- Keep and copy: 1,095 days × 0.5 TB = 547.5 TB, three copies = 1,642.5 TB.
- Margins: +25% temp, keep disks 70% full, +30% growth = 3,812.9 TB; with 96 TB per server that is 40 workers.
- NameNode: 256 MB files give 2.2 million files and 4.5 million blocks: under 1 GB of objects, so the heap is comfortable.
- Compute: the nightly 60 TB scan needs 291 containers at once; 40 workers offer 1,200. Storage decides, compute fits.
- Tiering: keep 90 hot days with three copies and the rest in erasure coding: 22 workers.
Size from the data, check with benchmarks. A sizing that starts from “we have budget for 20 servers” and works backwards is a budget, not a plan.
Benchmark first, then size
Run on the Module 8 lab with dfsio_lab.sh (in “Run it on your PC”), then do the arithmetic for the payments example.
Benchmark writes with one task
One map task writes one 64 MB file with three replicas. 113 MB/s is what one writer gets from our laptop's disk, through the DataNode pipeline.yarn org.apache.hadoop.fs.TestDFSIO -libjars $T -write -nrFiles 1 -fileSize 64MBTotal MBytes processed: 64 Throughput mb/sec: 113.48 Test exec time sec: 17.6Add writers
Per task the number drops; the total grows from about 113 to 185 to 210 MB/s and then flattens. Three “workers” sharing one disk can't add disk speed. On real servers, each node adds its own disks and the total keeps growing.write, 3 files: Throughput mb/sec: 61.82 write, 6 files: Throughput mb/sec: 34.99Benchmark reads
Reads look faster because the files were written seconds earlier and are still in memory (page cache). For an honest read benchmark, use files much larger than RAM or drop the caches first.read, 1 file: Throughput mb/sec: 320 read, 3 files: Throughput mb/sec: 175.34 read, 6 files: Throughput mb/sec: 130.3Storage for the payments company
Storage decides the cluster size. The compression ratio and disk per node are assumptions; measure the ratio on a sample of your real data (Lesson 10.2 measured about 0.14 for Parquet + zstd on our CSV, so 0.25 is a cautious choice).2 TB × 0.25 = 0.5 TB/day × 1,095 days = 547.5 TB × 3 copies = 1,642.5 TB × 1.25 temp ÷ 0.70 fill × 1.3 growth = 3,812.9 TB ÷ 96 TB per worker (12 × 8 TB) = 39.7 → 40 workersCheck NameNode heap and compute
Both fit with room to spare. If either did not, it would add nodes (compute), larger files (heap) or a second namespace (Lesson 7.2).files: 2,048 a day × 1,095 = 2,242,560; blocks: 4,485,120 objects × 150 B ≈ 0.9 GB (rule of thumb; plan a much larger heap) nightly work: 60 TB ÷ 20 MB/s = 3,145,728 container-seconds ÷ 10,800 s (3 h) = 291 containers at once; available 40 × 30 = 1,200Masters, edge and network
Spreading masters across racks means a single rack failure can't take the NameNode pair or the JournalNode quorum down (Lesson 7.1).masters: 3 servers (2 NN, 2 RM, 3 JN, 3 ZK, JobHistory), one per rack edge: 2 servers racks: 45 servers ÷ 20 per rack = 3 racks oversubscription: 20 × 10 Gb ÷ 80 Gb uplink = 2.5 : 1
Never copy a benchmark from a laptop, a VM or another company's blog into a purchase order. Run TestDFSIO and one real job on a candidate server first, and treat every typical value in this lesson as a placeholder for your own measurement.
Why more writers didn't mean more speed
Six steps of our TestDFSIO runs: what the tool printed and what was happening on the one shared disk.
- One writer: 113.48 MB/s for one 64 MB file with three replicas.
- Three writers: each gets 61.82 MB/s.
- Six writers: each gets only 34.99 MB/s.
- In total the cluster wrote about 113, 185 and 210 MB/s: it stopped scaling.
- Reads: 320 MB/s for one task, 130.3 each for six, helped by data still in memory.
- A real worker has many disks and its own network card, so totals keep growing with nodes.
- The three “workers” are containers on one laptop, all writing to the same physical disk.
- With three writers the disk's bandwidth is shared three ways.
- With six, each gets a smaller slice.
- The total grows only from 185 to 210 MB/s: the disk is saturated.
- Freshly written files are still in memory, so reads beat the disk's real speed.
- On real hardware every worker adds its own disks, which is why benchmarks must be run on the real thing.
Sizing at work
1. Payments: regulation drives retention
Payment companies keep transaction records for years by regulation. Retention × copies decides most of the cluster, so tiering old data to erasure coding or archive storage is the biggest cost lever.
2. E-commerce: the sale day sets the compute
Clickstream volume can be many times normal during a festival sale. Teams size compute for the peak night's window, and often burst extra capacity in the cloud for those days.
3. Telecom: format is the cheapest saving
Call records compress very well in columnar formats. Converting raw CDR text to ORC or Parquet often reduces the hardware more than any server discount.
4. Healthcare: file counts, not bytes
Hospitals store millions of small reports and image metadata files. Their sizing worry is NameNode heap, solved by packing files into containers or object storage, not by more disks.
5. Government: phased buying and growth
Public schemes grow as enrolment grows and data is rarely deleted. Planners model growth year by year and buy hardware in phases, reviewing against real usage before each purchase.
Simplified; organisations differ in tools and policies. Hardware figures in this lesson are assumptions for illustration.
A cluster sizing calculator
The assumptions are at the top. Change one and see which part of the cluster moves. Storage usually decides the number of workers; compute checks that the nightly work fits the window.
import math
# --- assumptions (change these) ---
RAW_TB_DAY, RATIO, DAYS = 2.0, 0.25, 3 * 365 # raw data per day, Parquet+zstd size ratio, retention
REPL, TEMP, FILL, GROWTH = 3, 1.25, 0.70, 1.3 # replication, +25% temp/shuffle, keep disks 70% full, +30%
DISK_TB_PER_NODE = 12 * 8 # 12 disks of 8 TB
NIGHTLY_SCAN_TB, MB_S_PER_CONTAINER, WINDOW_H = 60, 20, 3
stored = RAW_TB_DAY * RATIO * DAYS # TB kept, one copy
data = stored * REPL
disk = data * TEMP / FILL * GROWTH
workers = math.ceil(disk / DISK_TB_PER_NODE)
print(f"one copy {stored:.1f} TB -> x{REPL} = {data:.1f} TB -> disk to buy {disk:.1f} TB -> {workers} workers")
files = RAW_TB_DAY * RATIO * 1024 * 1024 / 256 * DAYS # 256 MB files
blocks = files * 2 # 128 MB blocks
print(f"{files:,.0f} files, {blocks:,.0f} blocks -> about {(files + blocks) * 150 / 2**30:.1f} GB of NameNode heap")
containers = NIGHTLY_SCAN_TB * 1024 * 1024 / MB_S_PER_CONTAINER / (WINDOW_H * 3600)
print(f"nightly work needs {containers:.0f} containers at once; {workers} workers x 30 = {workers * 30}")disk = data * TEMP / FILL * GROWTHTemp space for shuffle and staging, headroom so disks never pass 70%, and a year of growth.blocks = files * 2 # 128 MB blocksHeap depends on the number of files and blocks, not on bytes (Lesson 7.5).containers = NIGHTLY_SCAN_TB * 1024 * 1024 / MB_S_PER_CONTAINER / (WINDOW_H * 3600)Total work in container-seconds divided by the seconds you have.
Run it on your PC: benchmark your own cluster
TestDFSIO ships with Hadoop in the MapReduce tests jar. Each map task writes (or reads) one file; the result is the throughput per task. Run it inside the Module 8 lab's namenode container. It takes about 3 minutes and removes its files with -clean at the end.
TestDFSIO: 1, 3 and 6 parallel writers and readers
# dfsio_lab.sh: measure what our cluster can write and read (TestDFSIO), the input to any sizing exercise.
# Run inside lab8-namenode-1.
T=$(ls /opt/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-*-tests.jar)
export HADOOP_CLASSPATH=$T
for files in 1 3 6; do
for op in write read; do
yarn org.apache.hadoop.fs.TestDFSIO -libjars $T -$op -nrFiles $files -fileSize 64MB -resFile /tmp/dfsio.txt > /tmp/dfsio.log 2>&1
echo "== $op, $files file(s) x 64 MB in parallel"
grep -E "Total MBytes processed|Throughput mb/sec|Average IO rate|Test exec time" /tmp/dfsio.log | sed -E 's/^.*TestDFSIO:[0-9]+ - +/ /'
done
done
yarn org.apache.hadoop.fs.TestDFSIO -libjars $T -clean > /dev/null 2>&1
# On your PC, in the mr-lab folder:
# docker cp dfsio_lab.sh lab8-namenode-1:/tmp/
# docker exec lab8-namenode-1 bash /tmp/dfsio_lab.shReal output. “Throughput mb/sec” is per task (total MB ÷ the sum of task times). Multiply by the number of tasks for an approximate cluster total: about 113, 185 and 210 MB/s for writes. All three workers share one laptop disk, so the total stops growing. Reads look fast because the files were just written and sit in memory (page cache).
From terabytes a day to workers
Follow the storage calculation one multiplication at a time.
Worked examples: real problems, solved and traced in memory
Four sizing problems from different industries. Every assumption is written down, because a sizing is only as good as its assumptions.
How much disk for call records?
Problem statement
A telecom operator produces 800 GB of call detail records (CDRs) a day. They are kept for 2 years as ORC (about 20% of raw size), with replication 3, 25% temp space, disks at most 70% full. How many workers with 12 × 10 TB disks?
800 GB/day · 2 years · ORC 20% · 3 copies
116.8 TB stored, 350.4 TB with copies, 625.7 TB disk -> 6 workers
Approach
- Stored per day = raw × ratio.
- Data = stored × days × 3.
- Disk = data × 1.25 ÷ 0.70; workers = disk ÷ 120 TB, rounded up.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
A hospital that stores millions of small files
Problem statement
A hospital chain stores imaging metadata and report PDFs: 4 lakh files a day, average 300 KB each, kept 5 years. Estimate the NameNode heap at about 150 bytes per file and per block, and compare with packing each day into 1 GB SequenceFiles (Lesson 10.1).
4,00,000 files/day × 300 KB · 5 years
small files: 204 GB heap; packed: 0.26 GB heap
Approach
- Small files: 1 block each → 2 objects per file.
- Packed: day size ÷ 1 GB files, 8 blocks each.
- Heap = objects × 150 B.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Will the sale-day report finish in time?
Problem statement
On a sale day an e-commerce company must process 45 TB of clickstream between midnight and 3 AM. Each 4 GB container processes about 25 MB/s. The cluster has 30 workers with 30 containers each. Does it fit, and how much of the cluster does it use?
45 TB · 3 hours · 25 MB/s per container · 900 containers
needs 175 containers at once, has 900 -> 19% of the cluster
Approach
- Container-seconds = MB ÷ MB/s.
- Concurrent containers = container-seconds ÷ window seconds.
- Compare with 30 × 30.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Five years of a welfare scheme's data
Problem statement
A state welfare scheme stores 300 GB a day (after Parquet compression) and grows 40% a year. Data is kept forever. With replication 3, 25% temp space and 70% fill, how many 96 TB workers are needed at the end of each of the next 5 years?
300 GB/day in year 1 · +40%/year · keep forever
year 1: 109.5 TB kept -> 7 workers year 2: 262.8 TB kept -> 15 workers year 3: 477.4 TB kept -> 27 workers year 4: 777.9 TB kept -> 44 workers year 5: 1198.5 TB kept -> 67 workers
Approach
- Each year adds 365 × that year's daily volume.
- Accumulate, then apply copies, temp and fill.
- Round up per year.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Check yourself
Quick revision
Lesson 12.3 in one screen
- Storage: raw/day × compression ratio × retention days × copies (3, or about 1.5 with EC) × 1.25 temp ÷ 0.70 fill × growth.
- Workers = disk needed ÷ disk per node, rounded up. Example: 2 TB/day, 3 years → 3,812.9 TB → 40 workers (22 with cold data on RS-6-3).
- NameNode heap ≈ (files + blocks) × 150 B; keep files large. 2.2 M files + 4.5 M blocks ≈ 0.9 GB of objects; give the NameNode generous headroom.
- Compute: containers at once = work (container-seconds) ÷ window seconds; example 291 vs 1,200 available.
- Per node: RAM − reserve (OS, DataNode, NodeManager) = YARN pool; balance memory per vcore (Lesson 11.4).
- Masters: 2 NameNodes, 3 JournalNodes, 3 ZooKeeper, 2 ResourceManagers, JobHistory, plus edge nodes.
- Benchmark real hardware: our laptop lab wrote 113 MB/s with one task and saturated near 210 MB/s total.
Interview and viva questions
How do you calculate the size of a Hadoop cluster?
Start from storage: daily data volume × compression ratio × retention period × replication factor (3, or about 1.5 with erasure coding), add 20–30% for temporary and shuffle data, divide by the target disk fill (around 70%) and add growth. Divide by usable disk per worker to get the number of workers. Then check compute against the batch window, size the NameNode heap from the expected number of files and blocks, and add masters and edge nodes.
How much memory does a NameNode need?
Roughly 150 bytes per file, directory and block object as a rule of thumb, often summarised as about 1 GB of heap per million blocks. The real driver is the number of objects, so a cluster full of small files needs far more heap than one with the same bytes in large files. Leave plenty of headroom for growth and garbage collection.
What is TestDFSIO?
A benchmark in the Hadoop MapReduce tests jar. Each map task writes or reads one file in HDFS, and the job reports throughput per task and average I/O rate. It measures the storage path end to end (client, DataNodes, disks, network) and is used before and after hardware or configuration changes.
Why keep HDFS disks below 70–80% full?
Jobs need temporary space for map output, staging and new data; the balancer needs room to move blocks; when a node or disk fails, its replicas are re-created on the others; and nearly full disks make DataNodes and NodeManagers unhealthy. Headroom is what keeps a failure from turning into an outage.
Is it cheaper to run Hadoop in the cloud?
It depends on utilisation. Steady, always-busy clusters are often cheaper on owned or reserved hardware; spiky or experimental workloads benefit from cloud clusters that are created for a job and deleted, with data kept in object storage. Compare the full cost: servers, power, space and staff on one side; compute hours, storage, data transfer and support on the other.
Practice problems
Sizing exercises. Write your assumptions first, then calculate.
Copies on disk
10 TB of data with replication 3 vs RS-6-3 erasure coding: how much disk does each use?
10 TB
replication 3: 30 TB RS-6-3: 15.0 TB
Show solution and explanation
print("replication 3:", 10 * 3, "TB RS-6-3:", 10 * 1.5, "TB")How it works: 30 TB vs 15 TB. Our lab measured the same 2:1 shape: 422 MB vs 235 MB (Lesson 7.3, RS-3-2 there).
Aggregate throughput
Our TestDFSIO run reported 61.82 MB/s per task with 3 writers and 34.99 with 6. What was the total in each case?
per-task throughput × tasks
185.5 209.9 MB/s
Show solution and explanation
print(round(3 * 61.82, 1), round(6 * 34.99, 1), "MB/s")How it works: About 185 and 210 MB/s: doubling the writers added only 13% because one disk was shared.
Compression saves workers
The UPI example stores 0.5 TB/day as Parquet+zstd. If it stored raw CSV (2 TB/day), how many workers would 3 years need?
2 TB/day, no compression
15252 TB -> 159 workers
Show solution and explanation
import math
disk = 2.0 * 1095 * 3 * 1.25 / 0.70 * 1.3
print(f"{disk:.0f} TB -> {math.ceil(disk / 96)} workers")How it works: 159 workers instead of 40: the file format is a sizing decision (Lesson 10.2).
Memory per vcore
A worker has 256 GB RAM and 32 cores. Reserve 32 GB and 2 cores for the OS and daemons. With 1 vcore per container, what container size uses memory and CPU evenly?
224 GB, 30 vcores
7.5 GB per vcore
Show solution and explanation
print(f"{224 / 30:.1f} GB per vcore")How it works: About 7.5 GB: smaller containers leave memory idle, bigger ones leave cores idle (Lesson 11.4).
Ingest bandwidth
0.5 TB of new data arrives every day and must be loaded in a 2-hour window with 3 replicas. What write bandwidth must the cluster sustain?
0.5 TB × 3 in 2 hours
218 MB/s across the cluster
Show solution and explanation
mb = 0.5 * 1024 * 1024 * 3
print(f"{mb / 7200:.0f} MB/s across the cluster")How it works: About 218 MB/s, close to what our whole laptop lab could write. Forty production workers do this easily.
How many racks?
40 workers, 3 masters and 2 edge nodes, with at most 20 servers per rack. How many racks, and why spread masters across racks?
45 servers, 20 per rack
3 racks
Show solution and explanation
import math
print(math.ceil(45 / 20), "racks")How it works: 3 racks. Put the two NameNodes and the three JournalNodes in different racks so one rack failure can't take the quorum down.
Own or rent?
Owning 40 workers costs ₹6 crore over 3 years including power and staff (illustrative). A cloud cluster of the same size costs ₹1,500 per node-hour (illustrative). Above what average number of busy hours a day is owning cheaper?
₹6 crore / 3 years vs ₹1,500 × 40 nodes per hour
break-even at 0.9 cluster-hours a day
Show solution and explanation
own_per_day = 6e7 / (3 * 365)
cloud_per_hour = 1500 * 40
print(f"break-even at {own_per_day / cloud_per_hour:.1f} cluster-hours a day")How it works: About 0.9 hours a day with these made-up prices. Plug in real quotes before any decision; the shape of the calculation is what matters.
A sizing function
Write size(raw_tb_day, ratio, days, copies) returning the number of 96 TB workers (25% temp, 70% fill, 30% growth). Check it against the UPI example.
2.0, 0.25, 1095, 3
40 20
Show solution and explanation
import math
def size(raw_tb_day, ratio, days, copies, node_tb=96):
disk = raw_tb_day * ratio * days * copies * 1.25 / 0.70 * 1.3
return math.ceil(disk / node_tb)
print(size(2.0, 0.25, 1095, 3), size(2.0, 0.25, 1095, 1.5))How it works: 40 and 20. The 22 in the lesson keeps the last 90 days with 3 copies; putting everything on erasure coding would give 20.
Real-world scenario questions (asked in company interviews)
Sizing questions are common for experienced roles. Interviewers look for a method and stated assumptions, not a memorised number.
“We ingest 5 TB a day and keep it 2 years. How many nodes?”
The classic open question.
The interviewer is checking: a method with assumptions out loud.
Show a strong answer
- Ask: format and compression, replication or EC, growth, node hardware.
- Storage: 5 × ratio × 730 × 3 × 1.25 ÷ 0.7 × growth; divide by usable disk per node.
- Then check compute against the processing window and NameNode heap against file counts.
The NameNode needs a restart every few weeks: heap is full
Storage is only 40% used.
The interviewer is checking: objects vs bytes.
Show a strong answer
- Heap tracks files and blocks, so check FilesTotal and BlocksTotal and the average file size per folder.
- Fix the writers producing small files; compact old data (Lesson 7.5).
- Short term: raise heap with GC tuning; long term: federation if one namespace is too big (Lesson 7.2).
“Our test cluster writes 200 MB/s. Is that good?”
A trainee ran TestDFSIO on three virtual machines.
The interviewer is checking: understanding what was measured.
Show a strong answer
- Ask what is shared: if all VMs use one physical disk, adding writers won't add throughput.
- Look at per-task vs total, and whether reads came from page cache.
- Benchmark the real hardware with realistic file sizes and concurrency.
Finance asks for a 3-year hardware budget
Data grows 40% a year and nobody deletes anything.
The interviewer is checking: retention and tiering as levers.
Show a strong answer
- Model year by year with compounding growth; buy in phases, not all at once.
- Propose levers: retention policies, better formats, erasure coding or archive storage for cold data.
- Present a range with assumptions, and review it every quarter against real usage.