Minimize broadcast time for 100 GB file to 1,000 cluster nodes
System DesignModel answerLast updated
Design a fast file distribution system to deliver a 100 GB checkpoint from one origin to 1,000 workers, minimizing total transfer time.
Problem Context
You're building a file broadcast system for a machine learning cluster. Before launching a training job, you need to distribute a 100 GB model checkpoint from one storage server to 1,000 worker machines. The faster this distribution completes, the less time expensive GPUs sit idle.
Constraints and Environment
- File size: 100 GB (single immutable file)
- Target fleet: 1,000 worker nodes across roughly 25 racks in one datacenter
- Network hardware: Each machine has a 25 Gbps network card; racks are connected through spine switches with typical oversubscription ratios
- Success criteria: All workers have a verified, complete copy in minimal elapsed time
Your Task
Design a distribution system that achieves close to the theoretical minimum transfer time. Address:
- Bottleneck identification: Calculate how long different approaches would take and identify the fundamental limit
- Data partitioning: How should the file be split and transmitted to enable parallelism?
- Network topology: How do you arrange transfers to avoid congestion on inter-rack links?
- Reliability: How do you handle node failures or slowdowns without blocking the entire fleet?
- Coordination: What control plane is needed to orchestrate transfers and verify completion?
Provide concrete numbers, explain trade-offs, and describe the mechanisms that make your design work.
Hints
Hint 1
Calculate the time if one server uploads sequentially versus if every node can download at full speed simultaneously
Hint 2
Consider how pipelining techniques (like in networks or video streaming) can overlap transfers
Hint 3
Think about building a distribution graph where nodes relay data to each other, keeping rack boundaries in mind
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Model Answer
1. Establish the Bottleneck Through Calculation
Start by converting units and calculating bounds:
- File: 100 GB = 800 Gigabits
- Network: 25 Gbps per NIC
- Receivers: 1,000 nodes
Sequential upload from origin: If one server sends the file 1,000 times, it transmits 800 Tb total. At 25 Gbps, that's 32,000 seconds—nearly 9 hours. Unacceptable.
Physical lower bound: Each receiver must download 800 Gb. At 25 Gbps maximum, that's 32 seconds minimum. This is the target.
Key insight: The origin's single 25 Gbps uplink is insufficient to serve 1,000 clients directly. Once receivers start relaying chunks to other receivers, the origin ceases to be the bottleneck—every node's download capacity becomes the constraint.
2. Chunking and Pipeline Architecture
Divide the file into 16 MB chunks (6,400 total chunks). This size balances:
- Pipeline latency: Each chunk takes ~5 ms to transmit at 25 Gbps. Across many hops, smaller chunks reduce cumulative delay.
- Overhead: Larger chunks mean fewer hash computations and metadata operations.
Pipeline relay model: Arrange nodes in one or more chains. Each node:
- Receives chunks from its upstream neighbor
- Immediately forwards each chunk to its downstream neighbor (cut-through forwarding)
- Simultaneously writes chunks to local storage and verifies integrity
This hides depth: instead of waiting for the entire file at each level (which would take 32 seconds per level), each hop adds only one chunk's transmission time (~5 ms). A 1,000-node chain adds roughly 5 seconds of pipeline fill time beyond the base 32 seconds.
Generate a manifest before transfer begins: a list of chunk hashes (SHA-256) plus a root hash. Distribute this signed manifest through the control plane so nodes can verify chunks as they arrive.
3. Topology: Rack-Aware Chain Construction
Build chains that respect datacenter topology to avoid saturating inter-rack links.
Single-chain approach: Order nodes rack-by-rack:
origin → rack1_host1 → rack1_host2 → ... → rack1_host40
→ rack2_host1 → ... → rack25_host40
Each rack receives one inbound cross-rack stream and sends one outbound stream, both at 25 Gbps. Total spine traffic is about 25 concurrent flows—well within bisection capacity. All intra-rack hops stay under the top-of-rack switch.
Multi-stripe optimization: Divide chunks into 4 independent stripes, each following its own chain through the cluster. Each node:
- Receives 4 streams at ~6.25 Gbps each
- Forwards 4 streams at ~6.25 Gbps each
- Total utilization approaches 25 Gbps bidirectional
Rotate host ordering across stripes so a node near the head of one chain appears near the tail of another. This spreads impact if any single node degrades—it affects only one stripe instead of blocking everything downstream.
4. Handling Failures and Stragglers
Fast failure detection: TCP breaks or stalled transfers trigger alerts within 1-2 seconds. Workers send heartbeat messages with progress bitmaps to a coordinator every second.
Chain splicing: When a node fails mid-transfer:
- Upstream peer detects the break and reports to coordinator
- Coordinator instructs upstream to reconnect to the failed node's downstream successor
- Upstream resumes transmission from the last successfully acknowledged chunk
- Downstream nodes experience a brief stall (seconds), not a full restart
Straggler demotion: If a node consistently forwards below 70% of expected throughput for its stripe, the coordinator relocates it to the tail of the chain or converts it to a leaf node. Slow nodes then affect only their own completion time.
Gap filling: Nodes with missing chunks after the main wave completes can fetch chunks from any peer holding them, preferring same-rack neighbors. The coordinator provides peer lists for swarm-style repair.
5. Control Plane and API Design
Coordinator service (replicated with Raft or etcd for availability):
- Stores distribution job metadata, manifest, topology plan, and per-node progress bitmaps
- Never touches the data path—only control messages
APIs:
CreateJob(source_path, target_hosts, chunk_size)→ job_idGetTopology(job_id)→ returns parent and children per stripe for this hostReportProgress(bitmap_changes, throughput)→ sent every second from workersGetRepairPeers(missing_chunks)→ returns hosts that have needed chunksGetStatus(job_id)→ overall completion percentage, per-rack progress, straggler list
Data plane: Direct TCP (or RDMA) connections between peers. Frame format: (stripe_id, chunk_id, length, payload). Coordinator is never involved in chunk transfers.
Verification: Each node computes chunk hashes locally and compares against the manifest. Once all chunks pass verification and the root hash matches, the node reports VERIFIED status. The training system waits for all nodes to reach this state before proceeding.
6. Performance Estimation
With realistic TCP efficiency (~90-95%), expect:
- Base transfer time: 32-35 seconds (physical limit)
- Pipeline fill overhead: ~5 seconds (for 1,000-hop chains with 16 MB chunks)
- Cross-rack and failure handling: ~5 seconds buffer
Total estimated makespan: 40-45 seconds, compared to 9 hours for naive sequential upload. This is roughly 700x faster.
Common Mistakes to Avoid
- Ignoring the coordinator's load: Storing full per-chunk state for 1,000 nodes means 800 bytes × 1,000 = 800 KB of bitmap data, easily manageable
- Not calculating the naive approach: Interviewers want to see you quantify why the obvious solution fails
- Vague "use CDN" or "use BitTorrent": Explain the actual mechanism—how chunks flow, how failures are handled
- Missing integrity verification: Always include end-to-end checksum validation in the design
Extensions
If asked about larger scale (10,000 nodes) or WAN distribution: multiple stripe trees become essential to saturate receiver capacity. For cross-datacenter delivery, add regional staging nodes that each serve their local cluster with the same rack-aware chain technique.