From: Witold Kręcicki Date: Wed, 29 Jan 2020 14:16:02 +0000 (+0100) Subject: Increase inactivehandles and inactivereqs size for better reuse. X-Git-Tag: v9.17.1~90^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4791263def9cbc17efd6f95574e746e03605b084;p=thirdparty%2Fbind9.git Increase inactivehandles and inactivereqs size for better reuse. --- diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index ca0b1850076..81726b82a8c 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -33,6 +33,13 @@ #include "netmgr-int.h" #include "uv-compat.h" +/*% + * How many isc_nmhandles and isc_nm_uvreqs will we be + * caching for reuse in a socket. + */ +#define ISC_NM_HANDLES_STACK_SIZE 600 +#define ISC_NM_REQS_STACK_SIZE 600 + /*% * Shortcut index arrays to get access to statistics counters. */ @@ -898,14 +905,14 @@ isc__nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr, isc_nmsocket_type type, family = iface->addr.type.sa.sa_family; - *sock = (isc_nmsocket_t){ - .type = type, - .iface = iface, - .fd = -1, - .ah_size = 32, - .inactivehandles = isc_astack_new(mgr->mctx, 60), - .inactivereqs = isc_astack_new(mgr->mctx, 60) - }; + *sock = (isc_nmsocket_t){ .type = type, + .iface = iface, + .fd = -1, + .ah_size = 32, + .inactivehandles = isc_astack_new( + mgr->mctx, ISC_NM_HANDLES_STACK_SIZE), + .inactivereqs = isc_astack_new( + mgr->mctx, ISC_NM_REQS_STACK_SIZE) }; isc_nm_attach(mgr, &sock->mgr); sock->uv_handle.handle.data = sock;