summaryrefslogtreecommitdiffstats
path: root/transport/socket/src/socket.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-05-26 09:02:29 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-05-29 02:24:12 -0700
commit4e89da5054837a2266fe1732a309c341dd6cd663 (patch)
tree1fa963b827b5c3d74d0103bd04ce69f4b32baba1 /transport/socket/src/socket.h
parent23976ec1e8554963d5e6a868c3982a8baa3d361a (diff)
socket: New option: Set receive and send buffer size
..and hope for a chance to improve performance on high speed links like 10GigE. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'transport/socket/src/socket.h')
-rw-r--r--transport/socket/src/socket.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/transport/socket/src/socket.h b/transport/socket/src/socket.h
index 4f34e168..50d7d030 100644
--- a/transport/socket/src/socket.h
+++ b/transport/socket/src/socket.h
@@ -38,6 +38,20 @@
#define GF_DEFAULT_SOCKET_LISTEN_PORT 6996
+/* This is the size set through setsockopt for
+ * both the TCP receive window size and the
+ * send buffer size.
+ * Till the time iobuf size becomes configurable, this size is set to include
+ * two iobufs + the GlusterFS protocol headers.
+ * Linux allows us to over-ride the max values for the system.
+ * Should we over-ride them? Because if we set a value larger than the default
+ * setsockopt will fail. Having larger values might be beneficial for
+ * IB links.
+ */
+#define GF_DEFAULT_SOCKET_WINDOW_SIZE (512 * GF_UNIT_KB)
+#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (128 * GF_UNIT_KB)
+
typedef enum {
SOCKET_PROTO_STATE_NADA = 0,
SOCKET_PROTO_STATE_HEADER_COMING,
@@ -101,6 +115,7 @@ typedef struct {
int pending_count;
} incoming;
pthread_mutex_t lock;
+ int windowsize;
} socket_private_t;