d1681e
From 4448795af501355f3893aed05551ee62551e8438 Mon Sep 17 00:00:00 2001
d1681e
From: Milind Changire <mchangir@redhat.com>
d1681e
Date: Fri, 13 Apr 2018 14:51:32 +0530
d1681e
Subject: [PATCH 256/260] rpc: set listen-backlog to high value
d1681e
d1681e
Problem:
d1681e
On node reboot, when glusterd starts volumes rapidly, there's a flood of
d1681e
connections from the bricks to glusterd and from the self-heal daemons
d1681e
to the bricks. This causes SYN Flooding and dropped connections when the
d1681e
listen-backlog is not enough to hold the pending connections to
d1681e
compensate for the rate at which connections are accepted by the RPC
d1681e
layer.
d1681e
d1681e
Solution:
d1681e
Increase the listen-backlog value to 1024. This is a partial solution.
d1681e
Part of the solution is to rearm the listener socket early for quicker
d1681e
accept() of connections.
d1681e
See commit 6964640a977cb10c0c95a94e03c229918fa6eca8 (change 19833)
d1681e
d1681e
mainline:
d1681e
> Reviewed-on: https://review.gluster.org/19836
d1681e
> Change-Id: I56781149919dd6e18cc43884234c6f60f2c93f88
d1681e
> fixes: bz#1564600
d1681e
> Signed-off-by: Milind Changire <mchangir@redhat.com>
d1681e
d1681e
Change-Id: I1d7ac940eb5410cdbf7508a24bfdfc052b35170b
d1681e
BUG: 1563804
d1681e
Signed-off-by: Milind Changire <mchangir@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/135557
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
d1681e
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d1681e
---
d1681e
 rpc/rpc-transport/socket/src/socket.c | 7 +++++++
d1681e
 1 file changed, 7 insertions(+)
d1681e
d1681e
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
d1681e
index 157b5b7..a6be911 100644
d1681e
--- a/rpc/rpc-transport/socket/src/socket.c
d1681e
+++ b/rpc/rpc-transport/socket/src/socket.c
d1681e
@@ -4613,6 +4613,13 @@ struct volume_options options[] = {
d1681e
           .min   = GF_MIN_SOCKET_WINDOW_SIZE,
d1681e
           .max   = GF_MAX_SOCKET_WINDOW_SIZE
d1681e
         },
d1681e
+        { .key   = {"transport.listen-backlog"},
d1681e
+          .type  = GF_OPTION_TYPE_SIZET,
d1681e
+          .description = "This option uses the value of backlog argument that "
d1681e
+                         "defines the maximum length to which the queue of "
d1681e
+                         "pending connections for socket fd may grow.",
d1681e
+          .default_value = "1024",
d1681e
+        },
d1681e
         { .key   = {"transport.tcp-user-timeout"},
d1681e
           .type  = GF_OPTION_TYPE_INT,
d1681e
           .default_value = "0"
d1681e
-- 
d1681e
1.8.3.1
d1681e