Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Feb 2005 08:57:00 -0800 (PST)
From:      =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= <mbsd@pacbell.net>
To:        Martin Blapp <mb@imp.ch>
Cc:        Chris Lightfoot <chris@ex-parrot.com>
Subject:   Re: getline() very very slow on localhost on 5.X
Message-ID:  <20050203085004.G21031@sotec.home>
In-Reply-To: <20050203123816.A55976@cvs.imp.ch>
References:  <Pine.NEB.3.96L.1050203093641.68249O-100000@fledge.watson.org> <20050203123816.A55976@cvs.imp.ch>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi Martin,

Judging by the tcpdump, I'd say tpop3d needs to setockopt(TCP_NODELAY).

On Thu, 3 Feb 2005, Martin Blapp wrote:

[...]

> 12:57:37.443544 IP mx2i.53848 > mx1i.pop3: . ack 106497 win 34048 <nop,nop,timestamp 38840793 137977961>
> 12:57:37.444256 IP mx1i.pop3 > mx2i.53848: P 106497:114689(8192) ack 0 win 34048 <nop,nop,timestamp 137977971 38840793>

Pop server sends data.

> 12:57:37.543486 IP mx2i.53848 > mx1i.pop3: . ack 114689 win 34048 <nop,nop,timestamp 38840803 137977971>

100ms later - delayed ack from client.

> 12:57:37.545426 IP mx1i.pop3 > mx2i.53848: P 114689:122881(8192) ack 0 win 34048 <nop,nop,timestamp 137977982 38840803>

Pop server imediately sends some more data.

> 12:57:37.644410 IP mx2i.53848 > mx1i.pop3: . ack 122881 win 34048 <nop,nop,timestamp 38840813 137977982>

Another 100ms laterm another lone delayed ack from client.

> 12:57:37.645402 IP mx1i.pop3 > mx2i.53848: P 122881:131073(8192) ack 0 win 34048 <nop,nop,timestamp 137977992 38840813>

Etc...

> 12:57:37.743474 IP mx2i.53848 > mx1i.pop3: . ack 131073 win 34048 <nop,nop,timestamp 38840823 137977992>
> 12:57:37.744181 IP mx1i.pop3 > mx2i.53848: P 131073:139265(8192) ack 0 win 34048 <nop,nop,timestamp 137978001 38840823>
> 12:57:37.843553 IP mx2i.53848 > mx1i.pop3: . ack 139265 win 34048 <nop,nop,timestamp 38840833 137978001>
> 12:57:37.844312 IP mx1i.pop3 > mx2i.53848: P 139265:147457(8192) ack 0 win 34048 <nop,nop,timestamp 137978011 38840833>

[...]

Presumably FreeBSD doesn't do delayed acks and/or the Nagle algorithm
on the loopback interface.

    $.02,
    /Mikko



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050203085004.G21031>