I don't really know who to ask on this one, because mysql is unsupported
(obviously, as free software), but maybe someone on this list can tell me,
or at least point me in the right direction.
MySQL has the option to set TCP_NODELAY on the server's listening socket,
however, this is only compiled in on FreeBSD:
#if defined(IPTOS_THROUGHPUT) && !defined(HAVE_LINUXTHREADS) /* For
if (fd > 0)
int tos = IPTOS_THROUGHPUT;
if (!setsockopt(fd, IPPROTO_IP, IP_TOS, (void*) &tos, sizeof(tos)))
int nodelay = 1;
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay,
DBUG_PRINT("warning",("Couldn't set socket option for fast
This appears to be deliberately excluding the use of TCP_NODELAY on Linux
(presumably because of the Linux Threads package). What I want to know is,
whether there is a really good reason for NOT using TCP_NODELAY on Linux?
I have a strong suspicion that we are suffering severe performance hits at
our site because of this option.
I think this because running a query and sending the results to /dev/null
or a file takes 1.4 seconds. Sending the same query over the network
(100MBps) takes about 30 seconds and runs at 50k/s. tcpdump shows that
each packet sent by the server is immediately followed by an
acknowledgement (i.e. the server waits for acknowledgement before sending
another packet). TCP_NODELAY would seem to prevent this.
In any case I am about to remove the !defined(HAVE_LINUXTHREADS) condition
and run comparison benchmarks on the system (hopefully the benchmarks will
also pick up any possible data corruption). If anyone suspects that this
will cause data corruption, please could you let me know immediately
before I destroy all our company's data :-)
___ __ _
/ __// / ,__(_)_ | Chris Wilson <Chris.Wilson@stripped> Unix+Net+RC5 |
/ (_ / ,\/ _/ /_ \ | Will Internet Spam become legal in Europe on March 29th |
\__//_/_/_//_/___/ | Vote against it at: http://www.politik-digital.de/spam/ |