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

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