2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Add configuration option to set send/recv buffers on the nm sockets

This commit adds a new configuration option to set the receive and send
buffer sizes on the TCP and UDP netmgr sockets.  The default is `0`
which doesn't set any value and just uses the value set by the operating
system.

There's no magic value here - set it too small and the performance will
drop, set it too large, the buffers can fill-up with queries that have
already timeouted on the client side and nobody is interested for the
answer and this would just make the server clog up even more by making
it produce useless work.

The `netstat -su` can be used on POSIX systems to monitor the receive
and send buffer errors.
This commit is contained in:
Ondřej Surý
2020-12-02 20:51:38 +01:00
parent 089bfe20f9
commit 4509089419
17 changed files with 177 additions and 16 deletions

View File

@@ -709,6 +709,14 @@ struct isc_nm {
isc_barrier_t pausing;
isc_barrier_t resuming;
/*
* Socket SO_RCVBUF and SO_SNDBUF values
*/
atomic_int_fast32_t recv_udp_buffer_size;
atomic_int_fast32_t send_udp_buffer_size;
atomic_int_fast32_t recv_tcp_buffer_size;
atomic_int_fast32_t send_tcp_buffer_size;
#ifdef NETMGR_TRACE
ISC_LIST(isc_nmsocket_t) active_sockets;
#endif
@@ -1769,6 +1777,12 @@ isc__nm_socket_tcp_nodelay(uv_os_sock_t fd);
* Disables Nagle's algorithm on a TCP socket (sets TCP_NODELAY).
*/
void
isc__nm_set_network_buffers(isc_nm_t *nm, uv_handle_t *handle);
/*%>
* Sets the pre-configured network buffers size on the handle.
*/
/*
* typedef all the netievent types
*/