diff --git a/Documentation/MaxScale Configuration And Usage Scenarios-Z3.pdf b/Documentation/MaxScale Configuration And Usage Scenarios.pdf similarity index 100% rename from Documentation/MaxScale Configuration And Usage Scenarios-Z3.pdf rename to Documentation/MaxScale Configuration And Usage Scenarios.pdf diff --git a/Documentation/MaxScale Debug And Diagnostic Support-Z3.pdf b/Documentation/MaxScale Debug And Diagnostic Support.pdf similarity index 100% rename from Documentation/MaxScale Debug And Diagnostic Support-Z3.pdf rename to Documentation/MaxScale Debug And Diagnostic Support.pdf diff --git a/Documentation/MaxScale MySQL Cluster setup-Z3.pdf b/Documentation/MaxScale MySQL Cluster setup.pdf similarity index 100% rename from Documentation/MaxScale MySQL Cluster setup-Z3.pdf rename to Documentation/MaxScale MySQL Cluster setup.pdf diff --git a/Documentation/RabbitMQ Setup And MaxScale Integration-Z3.pdf b/Documentation/RabbitMQ Setup And MaxScale Integration.pdf similarity index 100% rename from Documentation/RabbitMQ Setup And MaxScale Integration-Z3.pdf rename to Documentation/RabbitMQ Setup And MaxScale Integration.pdf diff --git a/server/include/gw.h b/server/include/gw.h index c6b847866..822884f9b 100644 --- a/server/include/gw.h +++ b/server/include/gw.h @@ -23,8 +23,15 @@ // network buffer is 32K #define MAX_BUFFER_SIZE 32768 -// socket send buffer for backend -#define GW_BACKEND_SO_SNDBUF 1024 + +/** + * Configuration for send and receive socket buffer sizes for + * backend and cleint connections. + */ +#define GW_BACKEND_SO_SNDBUF 32768 +#define GW_BACKEND_SO_RCVBUF 32768 +#define GW_CLIENT_SO_SNDBUF 32768 +#define GW_CLIENT_SO_RCVBUF 32768 #define GW_NOINTR_CALL(A) do { errno = 0; A; } while (errno == EINTR) #define GW_MYSQL_LOOP_TIMEOUT 300000000 diff --git a/server/modules/include/mysql_client_server_protocol.h b/server/modules/include/mysql_client_server_protocol.h index cb2e41cd7..18771aecd 100644 --- a/server/modules/include/mysql_client_server_protocol.h +++ b/server/modules/include/mysql_client_server_protocol.h @@ -82,10 +82,6 @@ #endif #define GW_NOINTR_CALL(A) do { errno = 0; A; } while (errno == EINTR) -// network buffer is 32K -#define MAX_BUFFER_SIZE 32768 -// socket send buffer for backend -#define GW_BACKEND_SO_SNDBUF 1024 #define SMALL_CHUNK 1024 #define MAX_CHUNK SMALL_CHUNK * 8 * 4 #define ToHex(Y) (Y>='0'&&Y<='9'?Y-'0':Y-'A'+10) diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index 5425667d8..bace1eef5 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -1180,7 +1180,10 @@ int gw_MySQLAccept(DCB *listener) conn_open[c_sock] = true; #endif /* set nonblocking */ + sendbuf = GW_BACKEND_SO_SNDBUF; setsockopt(c_sock, SOL_SOCKET, SO_SNDBUF, &sendbuf, optlen); + sendbuf = GW_BACKEND_SO_RCVBUF; + setsockopt(c_sock, SOL_SOCKET, SO_RCVBUF, &sendbuf, optlen); setnonblocking(c_sock); client_dcb = dcb_alloc(DCB_ROLE_REQUEST_HANDLER); diff --git a/server/modules/protocol/mysql_common.c b/server/modules/protocol/mysql_common.c index 0dad65350..78e82cb86 100644 --- a/server/modules/protocol/mysql_common.c +++ b/server/modules/protocol/mysql_common.c @@ -34,6 +34,7 @@ * */ +#include #include "mysql_client_server_protocol.h" #include #include @@ -741,6 +742,7 @@ int gw_do_connect_to_backend( struct sockaddr_in serv_addr; int rv; int so = 0; + int bufsize; memset(&serv_addr, 0, sizeof serv_addr); serv_addr.sin_family = AF_INET; @@ -764,6 +766,10 @@ int gw_do_connect_to_backend( /* prepare for connect */ setipaddress(&serv_addr.sin_addr, host); serv_addr.sin_port = htons(port); + bufsize = GW_CLIENT_SO_SNDBUF; + setsockopt(so, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize)); + bufsize = GW_CLIENT_SO_RCVBUF; + setsockopt(so, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize)); /* set socket to as non-blocking here */ setnonblocking(so); rv = connect(so, (struct sockaddr *)&serv_addr, sizeof(serv_addr));