[30621] in Kerberos
Re: krb5_sendauth vs NAGLE vs DelayedAck
daemon@ATHENA.MIT.EDU (Ken Raeburn)
Wed Jan 14 16:57:18 2009
From: Ken Raeburn <raeburn@MIT.EDU>
To: John Hascall <john@iastate.edu>
In-Reply-To: <31033.1231964554@malison.ait.iastate.edu>
Message-Id: <5A74721A-E127-45FE-BE81-100F1127250C@mit.edu>
Mime-Version: 1.0 (Apple Message framework v930.3)
Date: Wed, 14 Jan 2009 16:52:34 -0500
Cc: kerberos@MIT.EDU
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: kerberos-bounces@MIT.EDU
On Jan 14, 2009, at 15:22, John Hascall wrote:
> I don't recall having seen this discussed on this
> list and google doesn't seem to either, so...
>
> I just discovered that hard way that the way that
> krb5_sendauth/krb5_recvauth work tickles the nasty
> interaction between the TCP NAGLE and DelayedAck
> features which inserts two ~200ms delays into the
> process:
Ouch. I ran into the same problem years ago with Emacs movemail's POP
support. Send "DELE 123", pause, send "\r\n", wait for response... a
delay per message to be deleted off the server, and if you're fetching
100 or so messages at a time, it adds up...
> My guess is that this occurs anywhere that the kerberos
> libs use krb5_write_message().
...which is fortunately not too many places, but that doesn't help you
today.
> My solution was just to do:
> int on = 1;
> setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
> before calling krb5_sendauth() but a "better" approach might
> be for krb5_write_message to end up calling writev so it
> does one write instead of two, I think.
Yes, I think that's probably best -- maybe via a helper function to
run a loop and manage the bookkeeping in case of short writes.
Ken
________________________________________________
Kerberos mailing list Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos