Coda File System

Re: Coda 5 On FreeBSD (is very slow !)

From: Jan Harkes <>
Date: Tue, 9 Apr 2002 12:34:27 -0400
On Tue, Apr 09, 2002 at 05:50:46PM +0200, Bruno Bonfils wrote:
> i just finish to install coda on a FreeBSD 4.5
> When i set a client, i try to copy a file of 180Mo. This operation
> cost more 10 minutes on a 100 Mb/s commuted LAN !!

Is this copy from Coda to Coda, or just copying a file into Coda?
I typically get about 3MB/s (30Mb/s) on a 100Base-T network, if the copy
involves both a fetch and a store that would end up being 1.5MB/s in
which case the copy should still be doable in 2 minutes. You are seeing
something closer to 300KB/s which is really unusually slow.

Sometimes SFTP gets into a bad state during a store. Fetches are
typically fast. It has to do with the fact that the transfer protocol
has one passive and one active side and it is possible to get into a
situation where the same data is sent multiple times over the wire.

Which version of RPC2 are you using? I have a patch that I haven't
checked into CVS that might actually help. It tries to avoid sending
duplicate acks by not acking a packet when there are packets left in
the kernel's socket buffer. (attached)

> I have this error on the SvrLog:
> Caution, replicated volume 0x1000002, resolution is turned off.

If you only have a single server (or singly replicated volumes) you
don't have to worry about this. This logmessage is generated whenever
the code used to leak some memory in a resolution log entry. This just
indicates that I haven't caught all places where we were adding
resolution log entries to volumes that are not replicated.


Index: rpc2-src/sftp.h
RCS file: /afs/cs/project/coda-src/cvs/rpc2/rpc2-src/sftp.h,v
retrieving revision 4.25
diff -u -r4.25 sftp.h
--- rpc2-src/sftp.h	2001/09/22 00:24:18	4.25
+++ rpc2-src/sftp.h	2002/04/09 16:32:54
@@ -448,6 +448,7 @@
 long sftp_ExtractFileFromPacket(struct SFTP_Entry *sEntry, RPC2_PacketBuffer *whichP);
 int sftp_AddPiggy(RPC2_PacketBuffer **whichP, char *dPtr, long dSize, long maxSize);
 void sftp_SetError(struct SFTP_Entry *s, enum SFState e);
+bool sftp_MorePackets(bool *rpc2, bool *sftp);
 extern long sftp_datas, sftp_datar, sftp_acks, sftp_ackr, sftp_busy,
Index: rpc2-src/sftp2.c
RCS file: /afs/cs/project/coda-src/cvs/rpc2/rpc2-src/sftp2.c,v
retrieving revision 4.33
diff -u -r4.33 sftp2.c
--- rpc2-src/sftp2.c	2001/09/22 00:24:19	4.33
+++ rpc2-src/sftp2.c	2002/04/09 16:32:54
@@ -64,7 +64,6 @@
 static void ServerPacket();
 static void SFSendNAK(RPC2_PacketBuffer *pb);
 static void sftp_ProcessPackets();
-static bool sftp_MorePackets();
 static void ScanTimerQ();
 static int AwaitEvent();
@@ -154,7 +153,7 @@
 /* This function is only called by SFTP_DispatchProcess, which is not called
  * by the sftp code itself */
-static bool sftp_MorePackets(bool *rpc2, bool *sftp)
+bool sftp_MorePackets(bool *rpc2, bool *sftp)
 /* This ioctl peeks into the socket's receive queue, and reports the amount
  * of data ready to be read. Linux officially uses TIOCINQ, but it's an alias
Index: rpc2-src/sftp3.c
RCS file: /afs/cs/project/coda-src/cvs/rpc2/rpc2-src/sftp3.c,v
retrieving revision 4.53
diff -u -r4.53 sftp3.c
--- rpc2-src/sftp3.c	2001/09/20 18:02:07	4.53
+++ rpc2-src/sftp3.c	2002/04/09 16:32:54
@@ -952,12 +952,18 @@
     RPC2_PacketBuffer *pb;
     long i, j;
     unsigned long now;
+    bool x, y, dont_ackme;
     if (sEntry->ReadAheadCount == 0)
 	{/* Nothing to send; but caller expects need ack limit to be set */
 	sEntry->SendAckLimit = sEntry->SendMostRecent;
+    /* try to avoid generating an ack when there might be ack packets queued up
+     * already and we're not sending a full window's worth */
+    dont_ackme = (sEntry->ReadAheadCount < sEntry->SendAhead) &&
+	sftp_MorePackets(&x, &y);
     /* j is the packet to be acked */
     if (sEntry->AckPoint > sEntry->ReadAheadCount)
@@ -968,7 +974,7 @@
 	pb = sEntry->ThesePackets[PBUFF((sEntry->SendMostRecent))];
-	if (sEntry->SendMostRecent == j)
+	if (!dont_ackme && sEntry->SendMostRecent == j)
 	    {/* Middle packet: demand ack */
 	    sEntry->SendAckLimit = sEntry->SendMostRecent;
 	    pb->Header.Flags = ntohl(pb->Header.Flags);
Received on 2002-04-09 12:36:00