Subject: Re: Slow backup performance...
To: Justin T. Gibbs <gibbs@plutotech.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 07/30/1998 10:58:10
On Wed, 29 Jul 1998 22:54:35 -0600 
 "Justin T. Gibbs" <gibbs@plutotech.com> wrote:

 > It's probably the same problem that Bill Fenner addressed in FreeBSD
 > a while ago:

Here's a patch that does the same in NetBSD's dump, and also puts back
the setting of TOS to "throughput" that was incorrectly removed at some
point.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 940 5942

Index: dumprmt.c
===================================================================
RCS file: /cvsroot/src/sbin/dump/dumprmt.c,v
retrieving revision 1.20
diff -c -r1.20 dumprmt.c
*** dumprmt.c	1998/03/30 01:54:40	1.20
--- dumprmt.c	1998/07/30 18:07:59
***************
*** 58,63 ****
--- 58,64 ----
  #include <netinet/in.h>
  #include <netinet/in_systm.h>
  #include <netinet/ip.h>
+ #include <netinet/tcp.h>
  
  #include <protocols/dumprestore.h>
  
***************
*** 132,142 ****
  	char *cp;
  	static struct servent *sp = NULL;
  	static struct passwd *pwd = NULL;
- #ifdef notdef
- 	static int on = 1;
- #endif
  	char *tuser, *name;
! 	int size;
  
  	if (sp == NULL) {
  		sp = getservbyname("shell", "tcp");
--- 133,140 ----
  	char *cp;
  	static struct servent *sp = NULL;
  	static struct passwd *pwd = NULL;
  	char *tuser, *name;
! 	int size, opt;
  
  	if (sp == NULL) {
  		sp = getservbyname("shell", "tcp");
***************
*** 172,177 ****
--- 170,181 ----
  	    setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0)
  		    size -= TP_BSIZE;
  	(void)setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size));
+ 
+ 	opt = IPTOS_THROUGHPUT;
+ 	(void)setsockopt(rmtape, IPPROTO_IP, IP_TOS, &opt, sizeof (opt));
+ 
+ 	opt = 1;
+ 	(void)setsockopt(rmtape, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof (opt));
  }
  
  static int