Skip to content

Commit

Permalink
bench: disable the sharded nros benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Reto Achermann <achreto@gmail.com>
  • Loading branch information
achreto committed Nov 13, 2023
1 parent b1fbc29 commit 6fee31f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 21 deletions.
20 changes: 7 additions & 13 deletions kernel/tests/s11_rackscale_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,12 @@ fn rackscale_memcached_checkout() {
}

println!(
"CHECKOUT fe0eb024882481717efd6a3f4600e96c99ca77a2 {:?}",
"CHECKOUT 0d90d53b99c3890b6e47efe08446e5180711ff09 {:?}",
out_dir
);

let res = Command::new("git")
.args(&["checkout", "fe0eb024882481717efd6a3f4600e96c99ca77a2"])
.args(&["checkout", "0d90d53b99c3890b6e47efe08446e5180711ff09"])
.current_dir(out_dir_path.as_path())
.output()
.expect("git checkout failed");
Expand Down Expand Up @@ -1113,6 +1113,7 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
}

#[test]
#[ignored]
#[cfg(not(feature = "baremetal"))]
fn s11_rackscale_memcached_benchmark_sharded_nros() {
use rexpect::process::signal::Signal::SIGKILL;
Expand Down Expand Up @@ -1319,24 +1320,17 @@ fn s11_rackscale_memcached_benchmark_sharded_nros() {
test.arg = Some(config);
test.run_dhcpd_for_baseline = true;
test.is_multi_node = true;
test.shmem_size = 0;

if !is_smoke {
test.shmem_size = std::cmp::max(
MEMCACHED_MEM_SIZE_MB * 2,
testutils::helpers::SHMEM_SIZE * 2,
);
}

fn cmd_fn(num_cores: usize, num_clients: usize, arg: Option<MemcachedShardedConfig>) -> String {
let config = arg.expect("missing configuration");
let num_threads = num_cores / num_clients;

format!(
r#"init=memcachedbench.bin initargs={} appcmd='--x-benchmark-no-run --disable-evictions --conn-limit=1024 --threads={} --x-benchmark-mem={} --memory-limit={}'"#,
num_threads,
num_threads,
config.mem_size,
config.mem_size * 2
r#"init=memcachedbench.bin initargs={num_threads} appcmd='--x-benchmark-no-run --disable-evictions --conn-limit=1024 --threads={num_threads} --x-benchmark-mem={} --memory-limit={}'"#,
config.mem_size * 2,
config.mem_size * 4
)
}

Expand Down
4 changes: 2 additions & 2 deletions kernel/testutils/src/configs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright © 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub const MEMCACHED_MEM_SIZE_MB: usize = 1 * 1024;
pub const MEMCACHED_NUM_QUERIES: usize = 500_000;
pub const MEMCACHED_MEM_SIZE_MB: usize = 4 * 1024;
pub const MEMCACHED_NUM_QUERIES: usize = 1_000_000;
48 changes: 46 additions & 2 deletions kernel/testutils/src/runner_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use rexpect::process::wait::WaitStatus;
use crate::builder::{BuildArgs, Built, Machine};
use crate::ExitStatus;

/// defines the threshold on when the output is truncated.
const PRINT_NUM_LINES: usize = 100;

/// Different build modes for rackscale
#[derive(Eq, PartialEq, Debug, Clone)]
pub enum RackscaleMode {
Expand Down Expand Up @@ -496,10 +499,26 @@ pub fn log_qemu_out(args: &RunnerArgs, output: String) {
log_qemu_out_with_name(Some(args), String::from(""), output)
}



pub fn log_qemu_out_with_name(args: Option<&RunnerArgs>, name: String, output: String) {
if !output.is_empty() {
println!("\n===== QEMU LOG {}=====", name);
println!("{}", &output);
let num_lines = output.lines().count();

if num_lines > PRINT_NUM_LINES {
for l in output.lines().take(PRINT_NUM_LINES / 2) {
println!(" > {}", l);
}
println!(" > ... {} more lines\n", num_lines - PRINT_NUM_LINES);
for l in output.lines().skip(num_lines - PRINT_NUM_LINES / 2) {
println!(" > {}", l);
}
} else {
for l in output.lines() {
println!(" > {l}");
}
}
println!("===== END QEMU LOG {}=====", name);
}
if let Some(nrk_args) = args {
Expand Down Expand Up @@ -620,7 +639,32 @@ pub fn wait_for_sigterm_or_successful_exit_no_log(
}
Err(e) => {
log_qemu_args(args);
panic!("Qemu testing failed: {} {}", name, e);
println!("Qemu testing failed: {} ", name);
use rexpect::errors::Error;
use rexpect::errors::ErrorKind::Timeout;
match e {
Error(Timeout(expected, got, timeout), st) => {
println!("Expected: `{expected}`\n");
println!("Got:",);
let count = got.lines().count();
if count > PRINT_NUM_LINES {
for l in got.lines().take(PRINT_NUM_LINES / 2) {
println!(" > {l}");
}
println!(" > ... skipping {} more lines...", count - PRINT_NUM_LINES);
for l in got.lines().skip(count - PRINT_NUM_LINES / 2) {
println!(" > {l}");
}
} else {
for l in got.lines() {
println!(" > {l}");
}
}
}
_ => println!("{e}")
}

panic!("Qemu testing failed");
}
e => {
log_qemu_args(args);
Expand Down
5 changes: 3 additions & 2 deletions scripts/ci.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUST_TEST_THREADS=1 cargo test --test s11* -- s11_rackscale_shmem_vmops_maplat_b
RUST_TEST_THREADS=1 cargo test --test s11* -- s11_rackscale_shmem_fxmark_bench --nocapture
RUST_TEST_THREADS=1 cargo test --test s11* -- s11_rackscale_memcached_benchmark_internal --nocapture
RUST_TEST_THREADS=1 cargo test --test s11* -- s11_rackscale_memcached_benchmark_sharded_linux --nocapture
RUST_TEST_THREADS=1 cargo test --test s11* -- s11_rackscale_memcached_benchmark_sharded_nros --nocapture
# disabled for now as this causes too much issues with running for now
# RUST_TEST_THREADS=1 cargo test --test s11* -- s11_rackscale_memcached_benchmark_sharded_nros --nocapture

# Clone repo
rm -rf gh-pages
Expand Down Expand Up @@ -66,7 +67,7 @@ mkdir -p ${DEPLOY_DIR}
mv memcached_benchmark_internal.csv ${DEPLOY_DIR}
mv memcached_benchmark_sharded_*.csv ${DEPLOY_DIR}
gzip ${DEPLOY_DIR}/memcached_benchmark_internal.csv
gzip ${DEPLOY_DIR}/memcached_benchmark_sharded_nros.csv
# gzip ${DEPLOY_DIR}/memcached_benchmark_sharded_nros.csv
gzip ${DEPLOY_DIR}/memcached_benchmark_sharded_linux.csv

# Copy vmops results
Expand Down
4 changes: 2 additions & 2 deletions usr/rkapps/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ fn main() {
.unwrap();

println!(
"CHECKOUT b2a11dee71b5181148830b8869b27742a8ebe96b {:?}",
"CHECKOUT eece690294fbfed418f43034b5dc77290865f8cf {:?}",
out_dir
);
Command::new("git")
.args(&["checkout", "b2a11dee71b5181148830b8869b27742a8ebe96b"])
.args(&["checkout", "eece690294fbfed418f43034b5dc77290865f8cf"])
.current_dir(&Path::new(&out_dir))
.status()
.unwrap();
Expand Down

0 comments on commit 6fee31f

Please sign in to comment.