-
Notifications
You must be signed in to change notification settings - Fork 119
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
Conversation
ff8042a
to
bca2e3e
Compare
pub struct Thread<'a, C: Client<'a>> { | ||
scenario: &'a scenario::Client, | ||
ops: &'a [op::Client], | ||
index: usize, | ||
op: Option<Op<'a, C>>, | ||
timer: Timer, | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
s2n-quic/netbench/netbench-scenarios/src/request_response.rs
Lines 84 to 88 in 483667d
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:
s2n-quic/netbench/netbench/src/scenario/builder/tests.rs
Lines 53 to 82 in 483667d
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()); | |
}, | |
); | |
}, |
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.