Re: How to turn off delayed acks (TCP performance problems)

Pete Ware (ware@cis.ohio-state.edu)
06 Aug 1997 10:46:35 -0400


"Bruce Thompson" <bt@raf.com> writes:

> My company developes a pseudo real-time client-server application that runs
> on it's own local network. I have noticed that if the server runs on the
> 2.0.x kernel, the time that it takes to send data on the network increases
> to about 400ms from about 30ms. I beleave this is due to delayed acks from
> looking at tcpdumps and seeing 200ms timeouts.
>
> How do I turn delayed acks off to see if this will help?

We just ran into a similar problem. Following is a from a program
that just bounces data between two processes over a TCP connection
(similar results for fast ethernet and over local loopback so it's not
the network hardware; same thing under 2.0.30 and 2.1.43).

Data size Round Trip Time (sec)

< 1280 ~0.000188
1280 0.49958
> 3000 ~0.019

We get this huge peek that jumps 500 times. It is also nearly a half
second which is the time for a delayed ack. We got rid of the problem
by turning off the Nagle silly window avoidance code:

int value = 1;

if( (setsockopt(sockfd,IPPROTO_TCP,TCP_NODELAY,
(int *) &value,sizeof(int))) < 0) {
perror("ERROR: setsockopt");
exit(1);
}

This also gave a slight improvement for larger data sizes as well.

In general, turning off the silly window avoidance is probably a bad
idea. I think its a problem in the code as other OSs don't exhibit
the same behaviour. However, mucking with TCP code isn't something
I'm up to.

--pete