[Date Prev][Date Next] [Chronological] [Thread] [Top]

Setting TCP_NODELAY on TCP sockets



Hello,

I am setting up a FreeBSD LDAP server and I was experiencing very poor
performance (5 ldap_search/sec using only one connection and a small
database) when querying the LDAP server (remotely and localy as well). I
however noticed that I could get better performance (around 30 req/s)
running my test client on a linux system.

After some experimentation (tcpdumping and so on) it camed out that the
slow performance was due to the fact that ip paquets between the server
and the client were smaller than the mss, and such the following ip
paquets were not sent until the previous one was ack'ed. (thus the
difference between freebsd and linux came from the difference in delay
between acks in the tcp stack of both systems). Setting TCP_NODELAY on
the socket in the server and the client solves the problem by disabling
nagle algorithm, and improves performance a lot (up to 300 req/s now).

I enclose a little patch I wrote to set up TCP_NODELAY (for 1.2.4). Do
you think this could be included in the main distribution ?

Gaël.

-- 
 Gaël Roualland - gael.roualland@iname.com
 ENSERB Informatique, 3ème année.

Attachment: openldap-1.2.4-TCP_NODELAY.patch
Description: Binary data