Skip to content

Commit

Permalink
feat: Add YCSB-A, B, D, E, and F workloads (#65)
Browse files Browse the repository at this point in the history
* ycsb_{a,b,d,f}

* table

* ycsb e

* benchmark/ycsb: drop cache before measurement start

---------

Co-authored-by: fia <[email protected]>
  • Loading branch information
pzittlau and fia0 authored Jan 13, 2025
1 parent 916cab7 commit 03effd6
Show file tree
Hide file tree
Showing 3 changed files with 562 additions and 4 deletions.
34 changes: 32 additions & 2 deletions betree/haura-benchmarks/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,36 @@ function ci() {
run "$RUN_IDENT" switchover_small switchover 4 "$((128 * 1024 * 1024))"
}

function ycsb() {
function ycsb_a() {
run "$RUN_IDENT" ycsb_a_block ycsb-a "$((8 * 1024 * 1024 * 1024))" 0 8
run "$RUN_IDENT" ycsb_a_memory ycsb-a "$((8 * 1024 * 1024 * 1024))" 1 8
}

function ycsb_b() {
run "$RUN_IDENT" ycsb_b_block ycsb-b "$((8 * 1024 * 1024 * 1024))" 0 8
run "$RUN_IDENT" ycsb_b_memory ycsb-b "$((8 * 1024 * 1024 * 1024))" 1 8
}

function ycsb_c() {
run "$RUN_IDENT" ycsb_c_block ycsb-c "$((8 * 1024 * 1024 * 1024))" 0 8
run "$RUN_IDENT" ycsb_c_memory ycsb-c "$((8 * 1024 * 1024 * 1024))" 1 8
}

function ycsb_d() {
run "$RUN_IDENT" ycsb_d_block ycsb-d "$((8 * 1024 * 1024 * 1024))" 0 8
run "$RUN_IDENT" ycsb_d_memory ycsb-d "$((8 * 1024 * 1024 * 1024))" 1 8
}

function ycsb_e() {
run "$RUN_IDENT" ycsb_e_block ycsb-e "$((8 * 1024 * 1024 * 1024))" 0 8
run "$RUN_IDENT" ycsb_e_memory ycsb-e "$((8 * 1024 * 1024 * 1024))" 1 8
}

function ycsb_f() {
run "$RUN_IDENT" ycsb_f_block ycsb-f "$((8 * 1024 * 1024 * 1024))" 0 8
run "$RUN_IDENT" ycsb_f_memory ycsb-f "$((8 * 1024 * 1024 * 1024))" 1 8
}

cargo build --release

if [ -z "$BETREE_CONFIG" ]
Expand Down Expand Up @@ -257,4 +282,9 @@ ensure_config
#checkpoints
#switchover
#ingest
#ycsb
# ycsb_a
# ycsb_b
# ycsb_c
# ycsb_d
# ycsb_e
# ycsb_f
80 changes: 80 additions & 0 deletions betree/haura-benchmarks/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,48 @@ enum Mode {
object_size: u64,
rewrite_count: u64,
},
YcsbA {
size: u64,
kind: u8,
threads: u32,
#[structopt(default_value = "120")]
runtime: u64,
},
YcsbB {
size: u64,
kind: u8,
threads: u32,
#[structopt(default_value = "120")]
runtime: u64,
},
YcsbC {
size: u64,
kind: u8,
threads: u32,
#[structopt(default_value = "120")]
runtime: u64,
},
YcsbD {
size: u64,
kind: u8,
threads: u32,
#[structopt(default_value = "120")]
runtime: u64,
},
YcsbE {
size: u64,
kind: u8,
threads: u32,
#[structopt(default_value = "120")]
runtime: u64,
},
YcsbF {
size: u64,
kind: u8,
threads: u32,
#[structopt(default_value = "120")]
runtime: u64,
},
}

fn run_all(mode: Mode) -> Result<(), Box<dyn Error>> {
Expand Down Expand Up @@ -170,6 +205,24 @@ fn run_all(mode: Mode) -> Result<(), Box<dyn Error>> {
let mut client = control.client(0, b"rewrite");
rewrite::run(&mut client, object_size, rewrite_count)?;
}
Mode::YcsbA {
size,
kind,
threads,
runtime,
} => {
let client = control.kv_client(0);
ycsb::a(client, size, threads as usize, runtime)
}
Mode::YcsbB {
size,
kind,
threads,
runtime,
} => {
let client = control.kv_client(0);
ycsb::b(client, size, threads as usize, runtime)
}
Mode::YcsbC {
size,
kind,
Expand All @@ -179,6 +232,33 @@ fn run_all(mode: Mode) -> Result<(), Box<dyn Error>> {
let client = control.kv_client(0);
ycsb::c(client, size, threads as usize, runtime)
}
Mode::YcsbD {
size,
kind,
threads,
runtime,
} => {
let client = control.kv_client(0);
ycsb::d(client, size, threads as usize, runtime)
}
Mode::YcsbE {
size,
kind,
threads,
runtime,
} => {
let client = control.kv_client(0);
ycsb::e(client, size, threads as usize, runtime)
}
Mode::YcsbF {
size,
kind,
threads,
runtime,
} => {
let client = control.kv_client(0);
ycsb::f(client, size, threads as usize, runtime)
}
}

thread::sleep(Duration::from_millis(2000));
Expand Down
Loading

0 comments on commit 03effd6

Please sign in to comment.