mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 09:45:31 +00:00
bencher: also bench aquatic_udp with io_uring
This commit is contained in:
parent
dfcf84adde
commit
c980c23ffc
8 changed files with 84 additions and 45 deletions
|
|
@ -100,6 +100,8 @@ pub struct NetworkConfig {
|
|||
pub socket_recv_buffer_size: usize,
|
||||
/// Poll timeout in milliseconds (mio backend only)
|
||||
pub poll_timeout_ms: u64,
|
||||
#[cfg(feature = "io-uring")]
|
||||
pub use_io_uring: bool,
|
||||
/// Number of ring entries (io_uring backend only)
|
||||
///
|
||||
/// Will be rounded to next power of two if not already one.
|
||||
|
|
@ -131,6 +133,8 @@ impl Default for NetworkConfig {
|
|||
socket_recv_buffer_size: 8_000_000,
|
||||
poll_timeout_ms: 50,
|
||||
#[cfg(feature = "io-uring")]
|
||||
use_io_uring: true,
|
||||
#[cfg(feature = "io-uring")]
|
||||
ring_size: 128,
|
||||
resend_buffer_max_len: 0,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,24 +49,18 @@ pub fn run_socket_worker(
|
|||
priv_dropper: PrivilegeDropper,
|
||||
) -> anyhow::Result<()> {
|
||||
#[cfg(all(target_os = "linux", feature = "io-uring"))]
|
||||
match self::uring::supported_on_current_kernel() {
|
||||
Ok(()) => {
|
||||
return self::uring::SocketWorker::run(
|
||||
config,
|
||||
shared_state,
|
||||
statistics,
|
||||
validator,
|
||||
request_sender,
|
||||
response_receiver,
|
||||
priv_dropper,
|
||||
);
|
||||
}
|
||||
Err(err) => {
|
||||
::log::warn!(
|
||||
"Falling back to mio because of lacking kernel io_uring support: {:#}",
|
||||
err
|
||||
);
|
||||
}
|
||||
if config.network.use_io_uring {
|
||||
self::uring::supported_on_current_kernel().context("check for io_uring compatibility")?;
|
||||
|
||||
return self::uring::SocketWorker::run(
|
||||
config,
|
||||
shared_state,
|
||||
statistics,
|
||||
validator,
|
||||
request_sender,
|
||||
response_receiver,
|
||||
priv_dropper,
|
||||
);
|
||||
}
|
||||
|
||||
self::mio::SocketWorker::run(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue