MXS-2073: Add missing TCP_NODELAY for client sockets

The client connections had the Nagle algorithm enabled which could cause
bad performance with smaller workloads. The common network configuration
code in utils.cc, currently used by the backend connections, sets it
properly.
This commit is contained in:
Markus Mäkelä
2018-09-27 18:56:15 +03:00
parent ee45900648
commit 93d866c6a7
4 changed files with 27 additions and 40 deletions

View File

@ -46,6 +46,20 @@ enum mxs_socket_type
bool utils_init(); /*< Call this first before using any other function */
void utils_end();
/**
* Configure network socket options
*
* This is a helper function for setting various socket options that are always wanted for all types
* of connections. It sets the socket into nonblocking mode, configures sndbuf and rcvbuf sizes
* and sets TCP_NODELAY (no Nagle algorithm).
*
* @param so Socket to configure
* @param type Socket type
*
* @return True if configuration was successful
*/
bool configure_network_socket(int so, int type);
/**
* @brief Create a network socket and a socket configuration
*