THINK FIRST·CODE LATER

← All labs

RAID planner

Problem

Input: number of disks n, disk size (TB), random IOPS per disk, read fraction; then RAID levels (RAID0, RAID1 as an n-way mirror, RAID5, RAID6, RAID10).

For each level compute usable capacity, failures tolerated (0 disks, n-1 disks, 1 disk, 2 disks, 1 per pair), write penalty (1, n, 4, 6, 2) and effective IOPS = n × IOPS / (read + (1 − read) × penalty).

Print the header level usable tolerates write-penalty effective-IOPS and one line per level with the format %-7s %6.1f TB %-10s %13d %14.0f.

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.