Subject: TCP_NODELAY for accept()ed sockets
To: None <tech-net@NetBSD.org>
From: Jaromir Dolecek <jaromir.dolecek@artisys.cz>
List: tech-net
Date: 01/15/2002 10:32:53
Hi,
after reading
	http://kerneltrap.com/article.php?sid=459

I've got to check what we do WRT TCP_DELAY and accept(2).
I've used dbench-1.3
from ftp://samba.org/pub/tridge/dbench/ to check the behaviour.
In order for the benchmark to not deadlock agains itself,
I had to up send/recvspace to:

net.inet.tcp.sendspace=65536
net.inet.tcp.recvspace=65536

Then, I found that indeed adding set_socket_options() after accept()
in tbench_srv.c would improve performance of the benchmark
tremendously. With the set_socket_options() call (which sets
TCP_NODELAY for the new socket) the performance of the benchmark
roughly matched Linux results.

I wonder if it would be suitable to make same change in NetBSD
TCP/IP code, i.e. make the accept(2)ed descriptors inherit
TCP_NODELAY from "parent". It sounds sensible to do so.

Jaromir
-- 
Jaromir Dolecek <jaromir.dolecek@artisys.cz>
ARTISYS, s.r.o., Stursova 71, 61600 Brno, Czech Republic
phone: +420-5-41224836 / fax: +420-5-41224870 / http://www.artisys.cz