mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
udp: uring: decrease request buffer sizes
This commit is contained in:
parent
fe294e8119
commit
587dd07131
2 changed files with 6 additions and 5 deletions
|
|
@ -34,7 +34,8 @@ use super::storage::PendingScrapeResponseSlab;
|
||||||
use super::validator::ConnectionValidator;
|
use super::validator::ConnectionValidator;
|
||||||
use super::{create_socket, EXTRA_PACKET_SIZE_IPV4, EXTRA_PACKET_SIZE_IPV6};
|
use super::{create_socket, EXTRA_PACKET_SIZE_IPV4, EXTRA_PACKET_SIZE_IPV6};
|
||||||
|
|
||||||
const BUF_LEN: usize = 8192;
|
const RESPONSE_BUF_LEN: usize = 8192;
|
||||||
|
const REQUEST_BUF_LEN: usize = 4096;
|
||||||
|
|
||||||
const USER_DATA_RECV: u64 = u64::MAX;
|
const USER_DATA_RECV: u64 = u64::MAX;
|
||||||
const USER_DATA_PULSE_TIMEOUT: u64 = u64::MAX - 1;
|
const USER_DATA_PULSE_TIMEOUT: u64 = u64::MAX - 1;
|
||||||
|
|
@ -119,7 +120,7 @@ impl SocketWorker {
|
||||||
|
|
||||||
let buf_ring = buf_ring::Builder::new(0)
|
let buf_ring = buf_ring::Builder::new(0)
|
||||||
.ring_entries(ring_entries)
|
.ring_entries(ring_entries)
|
||||||
.buf_len(BUF_LEN)
|
.buf_len(REQUEST_BUF_LEN)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use io_uring::opcode::SendMsg;
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
|
|
||||||
use super::{BUF_LEN, SOCKET_IDENTIFIER};
|
use super::{RESPONSE_BUF_LEN, SOCKET_IDENTIFIER};
|
||||||
|
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
NoBuffers,
|
NoBuffers,
|
||||||
|
|
@ -35,7 +35,7 @@ impl ResponseType {
|
||||||
struct SendBuffer {
|
struct SendBuffer {
|
||||||
name_v4: UnsafeCell<libc::sockaddr_in>,
|
name_v4: UnsafeCell<libc::sockaddr_in>,
|
||||||
name_v6: UnsafeCell<libc::sockaddr_in6>,
|
name_v6: UnsafeCell<libc::sockaddr_in6>,
|
||||||
bytes: UnsafeCell<[u8; BUF_LEN]>,
|
bytes: UnsafeCell<[u8; RESPONSE_BUF_LEN]>,
|
||||||
iovec: UnsafeCell<libc::iovec>,
|
iovec: UnsafeCell<libc::iovec>,
|
||||||
msghdr: UnsafeCell<libc::msghdr>,
|
msghdr: UnsafeCell<libc::msghdr>,
|
||||||
free: bool,
|
free: bool,
|
||||||
|
|
@ -61,7 +61,7 @@ impl SendBuffer {
|
||||||
sin6_addr: libc::in6_addr { s6_addr: [0; 16] },
|
sin6_addr: libc::in6_addr { s6_addr: [0; 16] },
|
||||||
sin6_scope_id: 0,
|
sin6_scope_id: 0,
|
||||||
}),
|
}),
|
||||||
bytes: UnsafeCell::new([0; BUF_LEN]),
|
bytes: UnsafeCell::new([0; RESPONSE_BUF_LEN]),
|
||||||
iovec: UnsafeCell::new(libc::iovec {
|
iovec: UnsafeCell::new(libc::iovec {
|
||||||
iov_base: null_mut(),
|
iov_base: null_mut(),
|
||||||
iov_len: 0,
|
iov_len: 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue