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

feat(netbench): add built-in drivers #1216

Merged
merged 8 commits into from
Mar 8, 2022
Merged

Conversation

camshaft
Copy link
Contributor

@camshaft camshaft commented Mar 5, 2022

Description of changes:

This change adds netbench drivers for s2n-quic, native-tls, and tcp. s2n-tls will be added after the async bindings are available.

I added a README on how to run one of the drivers locally. This will change after I get the CLI working, but should be enough to get an idea of how to run it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@camshaft camshaft marked this pull request as ready for review March 7, 2022 16:34
@camshaft camshaft requested a review from toidiu March 7, 2022 19:31
Comment on lines +15 to +21
pub struct Thread<'a, C: Client<'a>> {
scenario: &'a scenario::Client,
ops: &'a [op::Client],
index: usize,
op: Option<Op<'a, C>>,
timer: Timer,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: curious what the Thread abstraction is for. Are you simulating multi-threaded behavior? Pausing and restating threads?

It also seems like you are using HashSet as a checkpoint. What exactly is a checkpoint, and how are you using a u64 to control pause and go logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you simulating multi-threaded behavior? Pausing and restating threads?

Yeah the scenario can have "threads" which are just concurrently executing tasks. For example:

conn.scope(|scope| {
for _ in 0..count {
scope.spawn(request);
}
});

What exactly is a checkpoint, and how are you using a u64 to control pause and go logic?

It's just a way for one scenario thread to unblock another. For example, let's say we want to start sending on another stream after we've sent 1 MB:

let (cp1_rx, cp1_tx) = conn.checkpoint();
conn.concurrently(
|conn| {
conn.open_send_stream(
|local| {
local.set_send_rate(10.kilobytes() / 50.millis());
local.send(1.megabytes() / 2);
local.unpark(cp1_tx);
local.send(1.megabytes() / 2);
},
|peer| {
peer.set_receive_rate(10.kilobytes() / 50.millis());
peer.receive(1.megabytes());
},
);
},
|conn| {
conn.open_send_stream(
|local| {
local.park(cp1_rx);
local.set_send_rate(1024.bytes() / 50.millis());
local.send(1.megabytes());
},
|peer| {
peer.set_receive_rate(1024.bytes() / 50.millis());
peer.receive(1.megabytes());
},
);
},

@camshaft camshaft merged commit 222a807 into main Mar 8, 2022
@camshaft camshaft deleted the camshaft/netbench-driver branch March 8, 2022 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants