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

@ -2369,21 +2369,7 @@ dcb_accept(DCB *dcb)
{
dcb->stats.n_accepts++;
/* set nonblocking */
sendbuf = MXS_CLIENT_SO_SNDBUF;
if (setsockopt(c_sock, SOL_SOCKET, SO_SNDBUF, &sendbuf, optlen) != 0)
{
MXS_ERROR("Failed to set socket options: %d, %s", errno, mxs_strerror(errno));
}
sendbuf = MXS_CLIENT_SO_RCVBUF;
if (setsockopt(c_sock, SOL_SOCKET, SO_RCVBUF, &sendbuf, optlen) != 0)
{
MXS_ERROR("Failed to set socket options: %d, %s", errno, mxs_strerror(errno));
}
setnonblocking(c_sock);
configure_network_socket(c_sock, client_conn.ss_family);
client_dcb = dcb_alloc(DCB_ROLE_CLIENT_HANDLER, dcb->listener);