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