Design a High-Performance Computing Cluster
0%
Editorial Solution
System requirements
Functional
Capacity estimation
Compute
API design
Job Management
Database design
Lustre Parallel File System
High-level design
Request flows
Job Submission Flow
Detailed component design
Backfill Scheduling
Trade offs/Tech choices
InfiniBand vs Ethernet
Failure scenarios/bottlenecks
Compute Node Failure
Future improvements
ML-Driven Resource Prediction
Table of Contents
System requirements
Functional
Capacity estimation
Compute
API design
Job Management
Database design
Lustre Parallel File System
High-level design
Request flows
Job Submission Flow
Detailed component design
Backfill Scheduling
Trade offs/Tech choices
InfiniBand vs Ethernet
Failure scenarios/bottlenecks
Compute Node Failure
Future improvements
ML-Driven Resource Prediction
A climate simulation needs 256 CPU cores, 8 GPUs, and 2 TB of memory for 72 hours. While it runs, 50 other jobs wait. The cluster has 500 nodes, some with GPUs, some without. The scheduler must fit this job onto the right node combination without starving smaller jobs. This is the multi-dimensional bin-packing problem at the heart of HPC cluster design.
Functional
Parallel task execution: Jobs run across multiple nodes simultaneously using MPI (Message Passing Interface) for inter-node communication and OpenMP for intra-node parallelism. A fluid dynamics simulation might decompose a 3D grid into 256 subdomains, assigning each to a separate node. Each node computes its subdomain and exchanges boundary data with neighbors via MPI at every timestep. The system must launch, coordinate, and synchronize processes across hundreds of nodes, handling data distribution and result aggregation transparently.
The numbers reveal why naive first-come-first-served scheduling fails. With 500 nodes, 5,000 job submissions per hour, and jobs ranging from 1 node for 10 minutes to 256 nodes for 72 hours, the scheduler must reason about resource fragmentation across wildly different scales.
Compute
500 compute nodes, each with 64 CPU cores, 32,000 total cores. 128 of those nodes also carry 4 GPUs each (NVIDIA A100 or H100 class), 512 GPUs total. Each node has 256 GB RAM, 128 TB aggregate memory. These are the three resource dimensions the scheduler must pack against. A single node costs roughly $15,000-$50,000 depending on GPU configuration, making the total cluster investment $10-15 million. This capital cost is why utilization optimization matters, every 1% improvement in utilization recovers $100-150K of hardware value annually.
Two interaction patterns serve this system. REST APIs handle job lifecycle operations, submit, query, cancel. WebSocket connections provide real-time monitoring of running jobs, streaming live output and resource utilization metrics without polling. The distinction matters because HPC jobs run for hours or days, and researchers need continuous visibility into resource usage, convergence metrics, and potential issues without hammering the API with polling requests.
Job Management
POST /jobs: Submit a new job. The request body carries the execution script path (on Lustre), resource requirements (cores, GPUs, memory, wall time limit), priority level, dependency list (job IDs that must complete first), partition preference (CPU, GPU, or any), and notification preferences (webhook URL, email). Returns a job ID and initial queue position. The scheduler immediately evaluates whether the job can be scheduled or must wait in queue.
Three storage tiers serve radically different access patterns. Lustre handles TB-scale scientific datasets with parallel I/O across hundreds of nodes simultaneously. PostgreSQL stores job metadata, user records, and allocation history that require transactional consistency and durable persistence. Redis provides real-time node availability and scheduling queues that change every second and must be read in microseconds.
Lustre Parallel File System
The 1 PB Lustre deployment consists of metadata servers (MDS) and Object Storage Targets (OSTs). Files are striped across multiple OSTs, a 100 GB dataset splits into 1 MB chunks distributed round-robin across 10 OSTs, allowing 10 nodes to read different chunks simultaneously at aggregate bandwidth that scales linearly with OST count.
Five components, one shared file system. The Job Scheduler decides what runs where. The Resource Manager tracks node availability in real time. Compute Nodes execute the parallel workloads. Lustre stores input data, output results, and recovery checkpoints. Monitoring watches everything and alerts operators to anomalies. The architecture follows a clear separation: the management plane (Scheduler, Resource Manager, Monitoring) runs on dedicated management nodes, while the data plane (Compute Nodes, Lustre) handles job execution and I/O.
Web Portal: The user-facing interface for submitting jobs, monitoring status, viewing logs, and managing resource quotas. Translates user actions into REST API calls and maintains WebSocket connections for real-time job monitoring dashboards. Most HPC users also interact via CLI tools (sbatch, squeue, scancel) that directly call the same REST API.
Two flows define this system and represent the core operational loops that interviewers will probe. Job submission is complex, multi-step, and transactional, it must validate resources, check dependencies, find feasible node placements, and launch MPI processes atomically across potentially hundreds of nodes. Job execution is long-running, checkpoint-based, and fault-tolerant, it must survive node failures, storage hiccups, and network partitions during multi-day runs without losing more than a checkpoint interval of work.
Job Submission Flow
"How do you schedule 1,000 jobs onto 500 heterogeneous nodes?" is the defining question of this system. This is the GATE, the component where depth of understanding separates strong candidates from average ones. The scheduler solves a multi-dimensional bin-packing problem, each job needs specific cores, GPUs, and memory, and the scheduler must maximize cluster utilization while respecting priorities and fairness. Three mechanisms make this work: backfill scheduling (filling idle gaps with short jobs), preemption with checkpointing (freeing resources for urgent work without destroying progress), and fair-share priority adjustment (ensuring equitable access across research groups over time).
Backfill Scheduling
Three cascading decisions shape the cluster's performance profile, operational complexity, and cost. Each involves a genuine trade-off where the right answer depends on workload characteristics. How nodes interconnect determines whether tightly-coupled MPI simulations are feasible at scale. Bare-metal versus container execution determines the balance between raw performance and operational convenience. Static versus dynamic resource allocation determines whether the cluster maximizes utilization or management simplicity.
InfiniBand vs Ethernet
A 72-hour simulation on 256 nodes is 70 hours in when one node's GPU fails. Without checkpointing, 256 times 70 equals 17,920 node-hours are lost, the equivalent of running a single node for over 2 years. At $6 per node-hour, that is $107,000 of wasted computation from a single GPU failure. Every failure mode in an HPC cluster must be analyzed through this lens: how much computation is at risk, and what is the recovery cost?
Compute Node Failure
Four extensions move the cluster from a well-designed static installation to an adaptive, cost-efficient platform that responds to demand patterns and evolving hardware. Each addresses a limitation of the core design discussed above.
ML-Driven Resource Prediction
Historical job data contains exploitable patterns. A user's genomics pipeline always uses 90% of requested memory but only 60% of requested cores. The same simulation script with different input sizes has a predictable runtime relationship. A gradient-boosted tree model trained on features like user ID, job script hash, input data size, and requested resources can predict actual resource usage with 80-90% accuracy.
Try this problem yourself
Reading a solution is not the same as producing one under interview pressure. Design it on the whiteboard and get scored feedback.
0%
Editorial Solution
System requirements
Functional
Capacity estimation
Compute
API design
Job Management
Database design
Lustre Parallel File System
High-level design
Request flows
Job Submission Flow
Detailed component design
Backfill Scheduling
Trade offs/Tech choices
InfiniBand vs Ethernet
Failure scenarios/bottlenecks
Compute Node Failure
Future improvements
ML-Driven Resource Prediction
Table of Contents
System requirements
Functional
Capacity estimation
Compute
API design
Job Management
Database design
Lustre Parallel File System
High-level design
Request flows
Job Submission Flow
Detailed component design
Backfill Scheduling
Trade offs/Tech choices
InfiniBand vs Ethernet
Failure scenarios/bottlenecks
Compute Node Failure
Future improvements
ML-Driven Resource Prediction