Loading src/quic.cpp +30 −14 Original line number Diff line number Diff line Loading @@ -270,11 +270,16 @@ quic::quic(const std::string& addr, int port, int maxconnections, int sockopts) _last_activity = std::chrono::steady_clock::now(); // Enlarge the receive buffer so high-throughput clients don't // overrun the kernel queue between epoll_wait cycles. 4 MB keeps // up with ~3000 in-flight 1200-byte QUIC datagrams. int rcvbuf = 4 * 1024 * 1024; int sndbuf = 4 * 1024 * 1024; // overrun the kernel queue between epoll_wait cycles. 16 MB keeps // up with ~13000 in-flight 1200-byte QUIC datagrams -- confirmed via // /proc/net/snmp's Udp:RcvbufErrors counter that the previous 4 MB // default was overflowing (and silently dropping ~2% of packets) on a // single-threaded loopback bulk transfer at ~180k pkt/s; the kernel // clamps this to net.core.rmem_max/wmem_max regardless, so requesting // more here is always safe -- it just won't help until that sysctl // ceiling is also raised. int rcvbuf = 16 * 1024 * 1024; int sndbuf = 16 * 1024 * 1024; #ifdef _WIN32 const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf); Loading Loading @@ -333,10 +338,12 @@ quic::quic(const std::map<std::string, ssl::CertificateBundle>& certs, _last_activity = std::chrono::steady_clock::now(); // Enlarge the receive/send buffers so high-throughput clients don't // overrun the kernel queue between epoll_wait cycles. 4 MB keeps // up with ~3000 in-flight 1200-byte QUIC datagrams. int rcvbuf = 4 * 1024 * 1024; int sndbuf = 4 * 1024 * 1024; // overrun the kernel queue between epoll_wait cycles. 16 MB keeps up // with ~13000 in-flight 1200-byte QUIC datagrams -- see the matching // comment in quic's default constructor for why this was raised from // 4 MB (confirmed real kernel-level drops via /proc/net/snmp). int rcvbuf = 16 * 1024 * 1024; int sndbuf = 16 * 1024 * 1024; #ifdef _WIN32 const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf); Loading Loading @@ -3890,8 +3897,17 @@ void quic::connect(const std::string& addr, int port, bool nonblock) { // sized buffer, nothing dropped it, so it livelocked. Now fixed at the // source (processFrame()'s ack_eliciting out-param), so the buffer // increase is safe to re-apply. int rcvbuf = 4 * 1024 * 1024; int sndbuf = 4 * 1024 * 1024; // // Bumped from 4 MB to 16 MB: even at 4 MB, a single-threaded loopback // bulk transfer at ~180k pkt/s still measurably overflowed this (same // RcvbufErrors counter, ~2% of packets dropped per run) because the // kernel's per-datagram accounting overhead means the *usable* payload // capacity is well under the raw byte count requested. The kernel // clamps this to net.core.rmem_max/wmem_max regardless (4 MB on a // stock/unconfigured box), so asking for more here is always safe -- // it simply has no effect until that sysctl ceiling is also raised. int rcvbuf = 16 * 1024 * 1024; int sndbuf = 16 * 1024 * 1024; #ifdef _WIN32 const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf); const char* sndopt = reinterpret_cast<const char*>(&sndbuf); Loading Loading
src/quic.cpp +30 −14 Original line number Diff line number Diff line Loading @@ -270,11 +270,16 @@ quic::quic(const std::string& addr, int port, int maxconnections, int sockopts) _last_activity = std::chrono::steady_clock::now(); // Enlarge the receive buffer so high-throughput clients don't // overrun the kernel queue between epoll_wait cycles. 4 MB keeps // up with ~3000 in-flight 1200-byte QUIC datagrams. int rcvbuf = 4 * 1024 * 1024; int sndbuf = 4 * 1024 * 1024; // overrun the kernel queue between epoll_wait cycles. 16 MB keeps // up with ~13000 in-flight 1200-byte QUIC datagrams -- confirmed via // /proc/net/snmp's Udp:RcvbufErrors counter that the previous 4 MB // default was overflowing (and silently dropping ~2% of packets) on a // single-threaded loopback bulk transfer at ~180k pkt/s; the kernel // clamps this to net.core.rmem_max/wmem_max regardless, so requesting // more here is always safe -- it just won't help until that sysctl // ceiling is also raised. int rcvbuf = 16 * 1024 * 1024; int sndbuf = 16 * 1024 * 1024; #ifdef _WIN32 const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf); Loading Loading @@ -333,10 +338,12 @@ quic::quic(const std::map<std::string, ssl::CertificateBundle>& certs, _last_activity = std::chrono::steady_clock::now(); // Enlarge the receive/send buffers so high-throughput clients don't // overrun the kernel queue between epoll_wait cycles. 4 MB keeps // up with ~3000 in-flight 1200-byte QUIC datagrams. int rcvbuf = 4 * 1024 * 1024; int sndbuf = 4 * 1024 * 1024; // overrun the kernel queue between epoll_wait cycles. 16 MB keeps up // with ~13000 in-flight 1200-byte QUIC datagrams -- see the matching // comment in quic's default constructor for why this was raised from // 4 MB (confirmed real kernel-level drops via /proc/net/snmp). int rcvbuf = 16 * 1024 * 1024; int sndbuf = 16 * 1024 * 1024; #ifdef _WIN32 const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf); Loading Loading @@ -3890,8 +3897,17 @@ void quic::connect(const std::string& addr, int port, bool nonblock) { // sized buffer, nothing dropped it, so it livelocked. Now fixed at the // source (processFrame()'s ack_eliciting out-param), so the buffer // increase is safe to re-apply. int rcvbuf = 4 * 1024 * 1024; int sndbuf = 4 * 1024 * 1024; // // Bumped from 4 MB to 16 MB: even at 4 MB, a single-threaded loopback // bulk transfer at ~180k pkt/s still measurably overflowed this (same // RcvbufErrors counter, ~2% of packets dropped per run) because the // kernel's per-datagram accounting overhead means the *usable* payload // capacity is well under the raw byte count requested. The kernel // clamps this to net.core.rmem_max/wmem_max regardless (4 MB on a // stock/unconfigured box), so asking for more here is always safe -- // it simply has no effect until that sysctl ceiling is also raised. int rcvbuf = 16 * 1024 * 1024; int sndbuf = 16 * 1024 * 1024; #ifdef _WIN32 const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf); const char* sndopt = reinterpret_cast<const char*>(&sndbuf); Loading