Back of the napkin math Flashcards

1
Q

L1 cache reference time

A

0.5 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Branch mispredict time

A

5 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

L2 cache reference

A

7 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Mutex lock/unlock time

A

100 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Main memory reference time

A

100 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Compress 1K bytes with Zippy time

A

10,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Send 2K bytes over 1 Gbps network time

A

20,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Read 1 MB sequentially from memory time

A

250,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Round trip within same datacenter time

A

500,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Disk seek time

A

10,000,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Read 1 MB sequentially from network time

A

10,000,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Read 1 MB sequentially from disk time

A

30,000,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Send packet CA->Netherlands->CA time

A

150,000,000 ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which is more expensive and why: read or write?

A

Writes are 40 times more expensive than reads. Locking causes writes to become sequential which greatly reduces throughput. Additionally, synchronization of data is expensive when there are updates that need to be propogated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What observation can we make from these estimates?

A

Global shared data is expensive. This is a fundamental limitation of distributed systems. The lock contention in shared heavily written objects kills performance as transactions become serialized and slow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What should architecture be built around: read or writes? Why?

A

Architect for scaling writes. Writes are going to be the bottleneck in any architecture so making them be as parallel as possible will create a high capacity architecture.

17
Q

What should writes be optimized around?

A

Optimize for low write contention and for as many parallel writes as possible.

18
Q

What is BUD Optimization? And where do you apply it?

A

Bottlenecks, Unnecessary work, Duplicate work. You use this after you have come up with an initial solution to a problem.