Answers submitted by students

homework_answered_by_students(kor).xlsx

Homework Solutions

Question 1. (PPT - Jongki Park)

Why do LSM-tree and LevelDB use leveled structure?

# of Level Write performance Read Performance WAF RAF
Single Bad Good High Low
Multi Good Bad Low High

Question 2. (PPT - Jongki Park)

In leveldb, max size of level i is 10^iMB. But max size of level 0 is 8MB. Why?

Practice 1. (PPT - Suhwan Shin)

[A] $ ./db_bench --benchmarks="fillseq" 
[B] $ ./db_bench --benchmarks="fillrandom"
Benchmark duplicate key range Major Compaction Throughput Latency SAF
Fillseq No No High Low 1 (0.98)
Fillrandom Yes Yes Low High 1.275
* Q3. In benchmark A, SSTs are not written in L0. Why?
- Trivial Move

Practice 2. (PPT - Zhu Yongjie)

[Load] $ ./db_bench --benchmarks="fillrandom" --use_existing_db=0

[A] $ ./db_bench --benchmarks="readseq" --use_existing_db=1
[B] $ ./db_bench --benchmarks="readrandom" --use_existing_db=1
[C] $ ./db_bench --benchmarks="seekrandom" --use_existing_db=1
Benchmark Interface Throughput (MB/s) Latency (micros/op) I/O Access Level
readseq Get() high low sequential all
readrandom Iterator->Next() low high random access one by one
until find the key
seekrandom Iterator->Seek() lowest highest random all

Practice 3. (PPT - Suhwan Shin)

[A] $ ./db_bench --benchmarks="fillrandom" --value_size=100 --num=1000000 --compression_ratio=1
[B] $ ./db_bench --benchmarks="fillrandom" --value_size=1000 --num=114173 --compression_ratio=1

Note 1. key_size = 16B
Note 2. same total kv pairs size.
Note 3. # of B's entries = 114173 = (16+100)/(16+1000) * 1000000