IO Cost Model Reference Sheet
Official Formula Reference
This is the authoritative reference for all IO cost calculations used in CS145. Use these formulas and notations in all problems and solutions.
Quick Reference
Core Formula
IO Cost per Page:
C_r = Access Time + (Page Size รท Scan Speed)
C_w = Access Time + (Page Size รท Scan Speed)
Total IO Cost:
Total Cost = numPages ร C_r (for reads)
Total Cost = numPages ร C_w (for writes)
Key Variables
-
numPages: Number of pages to read/write
-
C_r: Actual time cost to read one page (calculated using formula above)
-
C_w: Actual time cost to write one page (calculated using formula above)
-
Page Size: Typically 64 MB in our examples
Device Specifications (2024)
We use these ballpark numbers for PSETs and Tests. Easy for math in Tests. In real life, different manufacturers will have different costs and speeds for commercial servers.
| Device | Access Time | Scan Speed | C_r (64MB page) | C_w (64MB page) |
|---|---|---|---|---|
| RAM | 100 ns | 100 GB/s | 0.00064s | 0.00064s |
| SSD | 10 ฮผs | 5 GB/s | 0.01281s | 0.01281s |
| HDD | 10 ms | 100 MB/s | 0.65s | 0.65s |
| Network | 1 ฮผs | 10 GB/s | 0.00641s | 0.00641s |
Unit Conventions
โข MB, GB = Decimal units (1000-based): 1 MB = 1,000,000 bytes, 1 GB = 1,000,000,000 bytes
โข MiB, GiB = Binary units (1024-based): 1 MiB = 1,048,576 bytes, 1 GiB = 1,073,741,824 bytes
All CS145 problems use MB/GB (decimal) consistently for calculations.
โข MiB, GiB = Binary units (1024-based): 1 MiB = 1,048,576 bytes, 1 GiB = 1,073,741,824 bytes
All CS145 problems use MB/GB (decimal) consistently for calculations.
This reference sheet is used throughout all system problems and solutions.