High Performance SSH/SCP - HPN-SSH when?

Darren Tucker dtucker at zip.com.au
Wed Apr 12 22:10:37 EST 2006


On Wed, Apr 12, 2006 at 01:46:32PM +0200, Corinna Vinschen wrote:
> Looks like another buffer might be in the way now, but I didn't look
> into this deeper so far.

Attached is a patch I started to play with that outputs the buffer
high water mark for each connection.

> Note that all tests are using a vanilla OpenSSH on the Linux side.
> I didn't want to add another variable to the test configuration.

Be aware that some of the hpn changes only kick in if it sees the other
end is also hpn.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
-------------- next part --------------
Index: buffer.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/buffer.c,v
retrieving revision 1.23
diff -u -p -r1.23 buffer.c
--- buffer.c	14 Mar 2005 12:22:26 -0000	1.23
+++ buffer.c	9 Apr 2006 01:22:58 -0000
@@ -18,6 +18,8 @@ RCSID("$OpenBSD: buffer.c,v 1.23 2005/03
 #include "buffer.h"
 #include "log.h"
 
+u_int buffer_hiwater = 4096;
+
 /* Initializes the buffer structure. */
 
 void
@@ -87,6 +89,9 @@ buffer_append_space(Buffer *buffer, u_in
 		buffer->end = 0;
 	}
 restart:
+	if (buffer->alloc > buffer_hiwater)
+		buffer_hiwater = buffer->alloc;
+
 	/* If there is enough space to store all data, store it now. */
 	if (buffer->end + len < buffer->alloc) {
 		p = buffer->buf + buffer->end;
Index: cleanup.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/cleanup.c,v
retrieving revision 1.1
diff -u -p -r1.1 cleanup.c
--- cleanup.c	2 Oct 2003 06:12:37 -0000	1.1
+++ cleanup.c	9 Apr 2006 01:00:00 -0000
@@ -22,5 +22,8 @@ RCSID("$OpenBSD: cleanup.c,v 1.1 2003/09
 void
 cleanup_exit(int i)
 {
+	extern u_int buffer_hiwater;
+
+	logit("buffer hiwater %u", buffer_hiwater);
 	_exit(i);
 }
Index: session.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/session.c,v
retrieving revision 1.312.2.1
diff -u -p -r1.312.2.1 session.c
--- session.c	7 Feb 2006 23:18:55 -0000	1.312.2.1
+++ session.c	9 Apr 2006 01:12:03 -0000
@@ -2424,6 +2424,7 @@ void
 do_cleanup(Authctxt *authctxt)
 {
 	static int called = 0;
+	extern u_int buffer_hiwater;
 
 	debug("do_cleanup");
 
@@ -2436,6 +2437,9 @@ do_cleanup(Authctxt *authctxt)
 		return;
 	called = 1;
 
+	error("%s buffer hiwater %u",
+	    mm_is_monitor() ? "monitor" : "slave", buffer_hiwater);
+
 	if (authctxt == NULL)
 		return;
 #ifdef KRB5
Index: ssh.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/ssh.c,v
retrieving revision 1.244
diff -u -p -r1.244 ssh.c
--- ssh.c	31 Dec 2005 05:33:37 -0000	1.244
+++ ssh.c	9 Apr 2006 01:31:13 -0000
@@ -78,6 +78,7 @@ RCSID("$OpenBSD: ssh.c,v 1.257 2005/12/2
 #endif
 
 extern char *__progname;
+extern u_int buffer_hiwater;
 
 /* Flag indicating whether debug mode is on.  This can be set on the command line. */
 int debug_flag = 0;
@@ -759,6 +760,8 @@ again:
 	exit_status = compat20 ? ssh_session2() : ssh_session();
 	packet_close();
 
+	error("buffer hiwater %u", buffer_hiwater);
+
 	if (options.control_path != NULL && control_fd != -1)
 		unlink(options.control_path);
 


More information about the openssh-unix-dev mailing list