Principles of Computer Systems
Autumn 2019
Stanford University
Computer Science Department
Lecturer: Chris Gregg
Philip Levis
n
2
n/2
A | B | C |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
=
A
B
C
Described up to RAID 5 (also, RAID 2, RAID 3, RAID 4)
Host OS
VMM
guest
OS
guest
OS
guest
OS
vi
bash
n
Host OS
VMM
a1.2xlarge
a1.large
management
a1.large
a1.large
a1.large
0.5ns | |||
5ns | |||
7ns | |||
25ns | |||
100ns | |||
3,000ns | 3us | ||
10,000ns | 10us | ||
150,000ns | 150us | ||
250,000ns | 250us | ||
500,000ns | 500us | ||
1,000,000ns | 1,000us | 1ms | |
10,000,000ns | 10,000us | 10ms | |
20,000,000ns | 20,000us | 20ms | |
150,000,000ns | 150,000us | 150ms |
L1 cache reference |
Branch mispredict |
L2 cache reference |
Mutex lock/unlock |
Main memory reference |
Compress 1K with Zippy |
Send 1K over 1Gbps network |
Read 4K randomly from SSD |
Read 1MB sequentially from RAM |
Round trip within a datacenter |
Read 1MB sequentially from SSD |
Hard disk seek |
Read 1MB sequentially from disk |
Send packet CA->Netherlands->CA |
There is a basic tradeoff in performance and size
If you make it bigger, it's slower
Takes longer to get to (due to size)
Addressing it is more complex (more bits to switch on)
Faster storage is more expensive
16GB RAM: $59.99
1TB HDD: $59.99
4TB HDD: $116.99
4TB SSD: $499.99
Think about the places your web page might be stored...
CPU cache
register
memory
web cache
proxy cache
website
0.3ns
7ns
100ns
20ms
25ms
100ms
reduce network use
Disk
Buffer Cache
Address Kbytes Mode Offset Device Mapping 000055bde4835000 8 r-x-- 0000000000000000 008:00008 gedit 000055bde4a36000 4 r---- 0000000000001000 008:00008 gedit 000055bde4a37000 4 rw--- 0000000000002000 008:00008 gedit 000055bde5d32000 13944 rw--- 0000000000000000 000:00000 [ anon ] 00007fc910000000 132 rw--- 0000000000000000 000:00000 [ anon ] 00007fc910021000 65404 ----- 0000000000000000 000:00000 [ anon ] 00007fc918000000 896 rw--- 0000000000000000 000:00000 [ anon ] 00007fc9180e0000 64640 ----- 0000000000000000 000:00000 [ anon ] 00007fc91c750000 204 r---- 0000000000000000 008:00008 UbuntuMono-R.ttf 00007fc91c783000 644 r-x-- 0000000000000000 008:00008 libaspell.so.15.2.0 00007fc91c824000 2048 ----- 00000000000a1000 008:00008 libaspell.so.15.2.0 00007fc91ca24000 20 r---- 00000000000a1000 008:00008 libaspell.so.15.2.0
active
inactive