MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jean-Francois Dockes Date:January 1 1970 12:00am
Subject:TCP_NODELAY improves select performance by 20
View as plain text  

Under some conditions (probably linked to the results size), setting
TCP_NODELAY on the server sockets can vastly improve mysql "select"
answer speed. 

More specifically, for a data size around 1500-1600 bytes, the time
per select goes down from around 100 mS to around 5 mS, with a server
running on a redhat 5.1 intel system. 

On another system (redhat 4.2 running mysql-3.21.33b), the time went
down from 34mS to < 3mS.

Of course this affects how much time the client waits for the answer, not
how much time the server is busy servicing it, so this may be important or
not, depending on the environment.


        Table structure:

CREATE TABLE session (
  sid varchar(80) DEFAULT '' NOT NULL,
  sestxt blob,
  upddate timestamp(14),

The test selects on 'sid'. The blob size is around 1500-1600 bytes.

        Just inconditionnaly compile the server to set TCP_NODELAY in 

>Submitter-Id:  <submitter ID>
>Originator:    J.F. Dockes <dockes@stripped>
  Jean-Francois Dockes, CDKIT SA          dockes@stripped
  Tel: +33 1 41 12 04 44                  Fax: +33 1 41 12 04 47
  56 Boulevard de la Republique           92210 SAINT CLOUD. FRANCE
>MySQL support: none
>Synopsis:      TCP_NODELAY improves select performance by 20
>Severity:      non-critical
>Priority:      low
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.22.14b-gamma (Source distribution)
>Server: mysqladmin  Ver 7.8 Distrib 3.22.14b-gamma, for pc-linux-gnu on i686
TCX Datakonsult AB, by Monty

Server version          3.22.14b-gamma
Protocol version        9
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 18 min 11 sec

Threads: 1  Questions: 22538  Slow queries: 1  Opens: 11  Flush tables: 1  Open 
tables: 2
Pentium II/350
System: Linux mouton 2.0.36 #20 Tue Jan 26 14:03:31 WET 1999 i686 unknown
Architecture: i686
redhat 5.1

The client was a sparc/solaris, but the 30->3 test was done with a linux 
Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/
gcc version
Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
Configure command: ./configure 
Perl: This is perl, version 5.004_04 built for i386-linux

To: mysql@stripped
Subject: TCP_NODELAY improves select performance by 20

TCP_NODELAY improves select performance by 20Jean-Francois Dockes30 Mar