diff --git a/Cargo.toml b/Cargo.toml index 6e1b86d..2060924 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,4 +8,9 @@ members = [ "client", "config" -] \ No newline at end of file +] + +[profile.release] +lto = true +debug = false +overflow-checks = false diff --git a/README.md b/README.md index d64cecc..1c81ac6 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,21 @@ TODO: 1C/4C with 3 runtimes, different connections, watch the throughput. ## Fixed QPS We can measure the latency and CPU utilization of different runtimes. -TODO: 1C/4C with 3 runtimes, different QPS, watch latency and CPU utilization. \ No newline at end of file +TODO: 1C/4C with 3 runtimes, different QPS, watch latency and CPU utilization. + +## How to run +Run diffrent servers: +``` +./target/release/monoio-server --cores 1 +./target/release/glommio-server --cores 1 +taskset -c 1 ./target/release/tokio-server --cores 1 + +./target/release/monoio-server --cores 1 2 3 4 +./target/release/glommio-server --cores 1 2 3 4 +taskset -c 1-4 ./target/release/tokio-server --cores 1 2 3 4 +``` + +Run client: +``` +./target/release/client --target 10.0.0.0:40000 --cores 1 2 3 4 --conns-per-core 150 +``` \ No newline at end of file diff --git a/client/src/main.rs b/client/src/main.rs index 24c1c99..1685265 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -48,6 +48,7 @@ CPU slot: {}", monoio::utils::bind_to_cpu_set(Some(cpu_)).unwrap(); let mut rt = RuntimeBuilder::new().with_entries(2560).enable_timer().build().unwrap(); rt.block_on(run_thread(count_, eps_, cfg_)); + println!("Thread {} finished", cpu_); }); } @@ -122,11 +123,13 @@ async fn run_conn( let (w, buf_w) = stream.write_all(buf).await; if w.is_err() { // The connection is closed. + println!("Write failed, connection exit"); return; } let (r, buf_r) = stream.read_exact(buf_w).await; if r.is_err() { // The connection is closed. + println!("Read failed, connection exit"); return; } let eps_ = begin.elapsed().as_micros() as u64; diff --git a/monoio-server/src/main.rs b/monoio-server/src/main.rs index ed5943d..31f9f6f 100644 --- a/monoio-server/src/main.rs +++ b/monoio-server/src/main.rs @@ -19,7 +19,7 @@ fn main() { let h = std::thread::spawn(move || { monoio::utils::bind_to_cpu_set(Some(cpu_)).unwrap(); let mut rt = RuntimeBuilder::new() - .with_entries(2560) + .with_entries(32768) .build() .unwrap(); rt.block_on(serve(cfg_)); diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..07ade69 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly \ No newline at end of file