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)
These are good ballpark numbers. Also, easy for math in Tests. In practice, 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.
Usage in Problems
When solving IO cost problems, always:
-
Identify the device type (RAM, SSD, HDD)
-
Determine access pattern (sequential vs random)
-
Calculate numPages needed
-
Apply the appropriate formula with C_r or C_w
-
Consider cache hierarchies if applicable
This reference sheet is used throughout all system problems and solutions.