Subject: kern/3008: NFS read from slow client is VERY slow!
To: None <gnats-bugs@gnats.netbsd.org>
From: =?ISO-2022-JP?B?Ik1JTk9VUkEgTWFrb3RvIC8gGyRCTCcxOhsoQiAbJEI/PxsoQiI=?= <minoura@kw.netlaputa.or.jp>
List: netbsd-bugs
Date: 12/08/1996 19:07:45
>Number:         3008
>Category:       kern
>Synopsis:       NFS read from slow client is VERY slow!
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Dec  8 04:05:02 1996
>Last-Modified:
>Originator:     Naofumi HONDA / MINOURA Makoto
>Organization:
NetBSD/pc98 Core Team
>Release:        Dec.8, '96
>Environment:
System: NetBSD daisy 1.2B NetBSD 1.2B (DAISY) #7: Sat Dec 7 19:09:41 JST 1996 root@daisy:/usr/src/sys/arch/i386/compile/DAISY i386


>Description:
	When NFS is used between fast server and slow client with
	read ahead is enabled, NFS reading is very slow.
	This is because client read from socket buffer (in client kernel)
	is slower than server's write of prefetched data, so that some
	packets may drop.  Increasing the socket buffer can solve this problem.
>How-To-Repeat:
>Fix:
	Written by Naofumi HONDA originally for NetBSD/pc98.
	Add options NFS_MULTISB=2 to the kernel config file.

diff -cr nfs.ORIG/nfs_socket.c nfs/nfs_socket.c
*** nfs.ORIG/nfs_socket.c	Tue Oct 15 01:48:55 1996
--- nfs/nfs_socket.c	Sun Dec  8 18:33:20 1996
***************
*** 255,261 ****
--- 255,265 ----
  		rcvreserve = (nmp->nm_rsize + NFS_MAXPKTHDR +
  		    sizeof (u_int32_t)) * 2;
  	}
+ #ifdef NFS_MULTISB
  	error = soreserve(so, sndreserve, rcvreserve);
+ #else
+ 	error = soreserve(so, sndreserve * NFS_MULTISB, rcvreserve * NFS_MULTISB);
+ #endif
  	if (error)
  		goto bad;
  	so->so_rcv.sb_flags |= SB_NOINTR;
diff -cr nfs.ORIG/nfs_syscalls.c nfs/nfs_syscalls.c
*** nfs.ORIG/nfs_syscalls.c	Tue Dec  3 21:20:02 1996
--- nfs/nfs_syscalls.c	Sun Dec  8 18:33:58 1996
***************
*** 396,402 ****
--- 396,406 ----
  		siz = NFS_MAXPACKET + sizeof (u_long);
  	else
  		siz = NFS_MAXPACKET;
+ #if NFS_MULTISB
  	error = soreserve(so, siz, siz); 
+ #else
+ 	error = soreserve(so, siz * NFS_MULTISB, siz * NFS_MULTISB); 
+ #endif
  	if (error) {
  		m_freem(mynam);
  		return (error);
>Audit-Trail:
>Unformatted: