Subject: Re: very slow TCP connection on localhost
To: Rui Paulo <>
From: Manuel Bouyer <>
List: tech-net
Date: 09/06/2006 16:46:35
On Wed, Sep 06, 2006 at 02:58:18PM +0100, Rui Paulo wrote:
> On Sep 5, 2006, at 5:45 PM, Manuel Bouyer wrote:
> >Hi,
> >I've been tracking down a speed issue with an amanda backup. The  
> >bottleneck
> >seems to be a TCP socket between 2 processes on the backup server,
> >which can transfers data at only a few 10s KB/s. netstat shows that  
> >the
> >receive queue on the reader side is always empty, while the send queue
> >on the sender side is always full. ktruss shows that the reader  
> >blocks on
> >read on the socket, and can read one or 2 64k block per second.
> >The writer blocks writing on the socket and can write only one or two
> >64k block per second. A tcpdump shows very bursty traffic on lo0, with
> >long pauses. This really looks like a TCP issue to me, maybe  
> >waiting for a
> >timeout before sending ACK, or something like that.
> >This is a 3.0_STABLE system from march.
> >Attached is the output of tcpdump -w on lo0 for this TCP connection.
> >Anyone has an idea about such behavior ?
> So, if it's a TCP issue, you can reproduce this with ttcp/nttcp, right?

Unfortunably not. I tried with various socket buffer size and write sizes,
and couldn't reproduce it. I guess amanda uses a special read/write pattern
(the writer is gzip in fact, I'm not sure what write size it uses),
or socket options.

Manuel Bouyer, LIP6, Universite Paris VI. 
     NetBSD: 26 ans d'experience feront toujours la difference