]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Increase inactivehandles and inactivereqs size for better reuse.
authorWitold Kręcicki <wpk@isc.org>
Wed, 29 Jan 2020 14:16:02 +0000 (15:16 +0100)
committerWitold Kręcicki <wpk@isc.org>
Fri, 28 Feb 2020 07:46:16 +0000 (08:46 +0100)
lib/isc/netmgr/netmgr.c

index ca0b1850076f2f67e9dc929d193b5af0221ad942..81726b82a8c252aea43cfa5be38ab1b09fd87521 100644 (file)
 #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;