Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bulk benchmark improvements #1657

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bench/src/bin/bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,25 @@ fn main() {
let key = rustls::PrivateKey(cert.serialize_private_key_der());
let cert = rustls::Certificate(cert.serialize_der().unwrap());

let server_span = tracing::error_span!("server");
let runtime = rt();
let (server_addr, endpoint) = server_endpoint(&runtime, cert.clone(), key, &opt);
let (server_addr, endpoint) = {
let _guard = server_span.enter();
server_endpoint(&runtime, cert.clone(), key, &opt)
};

let server_thread = std::thread::spawn(move || {
let _guard = server_span.entered();
if let Err(e) = runtime.block_on(server(endpoint, opt)) {
eprintln!("server failed: {e:#}");
}
});

let mut handles = Vec::new();
for _ in 0..opt.clients {
for id in 0..opt.clients {
let cert = cert.clone();
handles.push(std::thread::spawn(move || {
let _guard = tracing::error_span!("client", id).entered();
let runtime = rt();
match runtime.block_on(client(server_addr, cert, opt)) {
Ok(stats) => Ok(stats),
Expand Down
5 changes: 5 additions & 0 deletions bench/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ pub fn transport_config(opt: &Opt) -> quinn::TransportConfig {
let mut config = quinn::TransportConfig::default();
config.max_concurrent_uni_streams(opt.max_streams.try_into().unwrap());
config.initial_mtu(opt.initial_mtu);

let mut acks = quinn::AckFrequencyConfig::default();
acks.ack_eliciting_threshold(10u32.into());
config.ack_frequency_config(Some(acks));

config
}

Expand Down