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

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