mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
udp: improve defaults for worker channel size and socket recv buffer
This commit is contained in:
parent
c4e644cb23
commit
4249a7f48d
1 changed files with 5 additions and 5 deletions
|
|
@ -58,7 +58,7 @@ impl Default for Config {
|
||||||
socket_workers: 1,
|
socket_workers: 1,
|
||||||
swarm_workers: 1,
|
swarm_workers: 1,
|
||||||
log_level: LogLevel::Error,
|
log_level: LogLevel::Error,
|
||||||
worker_channel_size: 1024 * 128,
|
worker_channel_size: 4_096,
|
||||||
request_channel_recv_timeout_ms: 100,
|
request_channel_recv_timeout_ms: 100,
|
||||||
network: NetworkConfig::default(),
|
network: NetworkConfig::default(),
|
||||||
protocol: ProtocolConfig::default(),
|
protocol: ProtocolConfig::default(),
|
||||||
|
|
@ -92,11 +92,11 @@ pub struct NetworkConfig {
|
||||||
/// values for different operating systems:
|
/// values for different operating systems:
|
||||||
///
|
///
|
||||||
/// macOS:
|
/// macOS:
|
||||||
/// $ sudo sysctl net.inet.udp.recvspace=6000000
|
/// $ sudo sysctl net.inet.udp.recvspace=8000000
|
||||||
///
|
///
|
||||||
/// Linux:
|
/// Linux:
|
||||||
/// $ sudo sysctl -w net.core.rmem_max=104857600
|
/// $ sudo sysctl -w net.core.rmem_max=8000000
|
||||||
/// $ sudo sysctl -w net.core.rmem_default=104857600
|
/// $ sudo sysctl -w net.core.rmem_default=8000000
|
||||||
pub socket_recv_buffer_size: usize,
|
pub socket_recv_buffer_size: usize,
|
||||||
/// Poll timeout in milliseconds (mio backend only)
|
/// Poll timeout in milliseconds (mio backend only)
|
||||||
pub poll_timeout_ms: u64,
|
pub poll_timeout_ms: u64,
|
||||||
|
|
@ -129,7 +129,7 @@ impl Default for NetworkConfig {
|
||||||
Self {
|
Self {
|
||||||
address: SocketAddr::from(([0, 0, 0, 0], 3000)),
|
address: SocketAddr::from(([0, 0, 0, 0], 3000)),
|
||||||
only_ipv6: false,
|
only_ipv6: false,
|
||||||
socket_recv_buffer_size: 4096 * 128,
|
socket_recv_buffer_size: 8_000_000,
|
||||||
poll_timeout_ms: 50,
|
poll_timeout_ms: 50,
|
||||||
#[cfg(feature = "io-uring")]
|
#[cfg(feature = "io-uring")]
|
||||||
ring_size: 1024,
|
ring_size: 1024,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue