andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

Blame SOURCES/0015-Issue-4315-performance-search-rate-nagle-triggers-hi.patch

27c138
From 4c133d448f451b7c3b2ff1b42806c7516d623f09 Mon Sep 17 00:00:00 2001
27c138
From: tbordaz <tbordaz@redhat.com>
27c138
Date: Mon, 7 Dec 2020 00:41:27 +0100
27c138
Subject: [PATCH] Issue 4315: performance search rate: nagle triggers high rate
27c138
 of setsocketopt (#4437)
27c138
27c138
Bug description:
27c138
	When a socket is set with NO_DELAY=0 (nagle), written pdu are buffered
27c138
	until buffer is full or tcp_cork is set. This reduce network traffic when
27c138
        the application writes partial pdu.
27c138
        DS write complete pdu (results/entries/..) so it gives low benefit for DS.
27c138
	In addition nagle being 'on' by default, DS sets/unset socket tcp_cork to send
27c138
	immediately results/entries at each operation. This is an overhead of syscalls.
27c138
27c138
Fix description:
27c138
	Disable nagle by default
27c138
27c138
relates: https://github.com/389ds/389-ds-base/issues/4315
27c138
27c138
Reviewed by: @mreynolds389, @Firstyear
27c138
27c138
Platforms tested:  F33
27c138
---
27c138
 ldap/servers/slapd/libglobs.c | 9 ++++-----
27c138
 1 file changed, 4 insertions(+), 5 deletions(-)
27c138
27c138
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
27c138
index 7d5374c90..f8cf162e6 100644
27c138
--- a/ldap/servers/slapd/libglobs.c
27c138
+++ b/ldap/servers/slapd/libglobs.c
27c138
@@ -1635,12 +1635,11 @@ FrontendConfig_init(void)
27c138
 #endif /* USE_SYSCONF */
27c138
 
27c138
     init_accesscontrol = cfg->accesscontrol = LDAP_ON;
27c138
-#if defined(LINUX)
27c138
-    /* On Linux, by default, we use TCP_CORK so we must enable nagle */
27c138
-    init_nagle = cfg->nagle = LDAP_ON;
27c138
-#else
27c138
+
27c138
+    /* nagle triggers set/unset TCP_CORK setsockopt per operation
27c138
+     * as DS only sends complete PDU there is no benefit of nagle/tcp_cork
27c138
+     */
27c138
     init_nagle = cfg->nagle = LDAP_OFF;
27c138
-#endif
27c138
     init_security = cfg->security = LDAP_OFF;
27c138
     init_ssl_check_hostname = cfg->ssl_check_hostname = LDAP_ON;
27c138
     cfg->tls_check_crl = TLS_CHECK_NONE;
27c138
-- 
27c138
2.26.2
27c138