From owner-freebsd-hackers Sat Dec 1 12:13:36 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (Postfix) with ESMTP id AF5D737B416 for ; Sat, 1 Dec 2001 12:13:27 -0800 (PST) Received: from whizzo.transsys.com (#6@localhost.transsys.com [127.0.0.1]) by whizzo.transsys.com (8.11.6/8.11.6) with ESMTP id fB1KDJE91870; Sat, 1 Dec 2001 15:13:19 -0500 (EST) (envelope-from louie@whizzo.transsys.com) Message-Id: <200112012013.fB1KDJE91870@whizzo.transsys.com> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Tomas Svensson Cc: Matthew Dillon , Josef Karthauser , freebsd-hackers@FreeBSD.ORG X-Image-URL: http://www.transsys.com/louie/images/louie-mail.jpg From: "Louis A. Mamakos" Subject: Re: SSH stalls (was: FreeBSD performing worse than Linux?) References: <20011201173240.A20807@simba.systemteknik.net> In-reply-to: Your message of "Sat, 01 Dec 2001 17:32:40 +0100." <20011201173240.A20807@simba.systemteknik.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 01 Dec 2001 15:13:19 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > I am not using compression and netstat -s confirms that it is really > resending data. I examined it a bit more now and it seems OpenSSH 2.5 is > sending a burst of small packets, each with 100 or 116 bytes > > 14:30:46.232151 server.22 > client.1525: P 30977:31077(100) ack 1144 win 24820 > 14:30:46.233358 server.22 > client.1525: P 31077:31177(100) ack 1144 win 24820 > > and another 50 small packets just like them rapidly after eachother. > After this it will start to send bigger packets, 1076 or 1460 but its too > late and its likely that the server will have to resend part of the small > packets and connection will stall. This won't be a problem on a LAN but > over the internet it can be. SSH Inc sshd doesn't have this problem as it > always send 1460 bytes per packet when possible. I have not been able to > reproduce this with OpenSSH 2.3.0 because it seems to send 276-300 bytes > per packet. This might be because our OpenSSH disables Nagle's algorithm by turning on the TCP_NODELAY socket option. See packet.c:packet_set_interactive() for the code that does this. This certainly will cause a bunch of small TCP segments to be generated, back-to-back before an TCP ACK is received. It's also probably a bad idea to enable by default for every SSH interactive session. It looks like this gets turned on for X11 connection forwarding and for SSH sessions with a PTY at the server end. louie To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message