viced-make-send-buffersize-tunable-20021122

idea from chas williams. arguably should be made larger than 16k also.
This commit is contained in:
Derrick Brashear 2002-11-23 01:51:43 +00:00
parent 4e52d08bea
commit 3b95323f9f
4 changed files with 20 additions and 6 deletions

View File

@ -1874,8 +1874,6 @@ afs_int32 SRXAFS_ResidencyCmd (struct rx_call *acall, struct AFSFid *Fid,
return EINVAL;
}
#define AFSV_BUFFERSIZE 16384
static struct afs_buffer {
struct afs_buffer *next;
} *freeBufferList = 0;
@ -1901,7 +1899,7 @@ static char *AllocSendBuffer()
afs_buffersAlloced++;
if (!freeBufferList) {
FS_UNLOCK
return malloc(AFSV_BUFFERSIZE);
return malloc(sendBufSize);
}
tp = freeBufferList;
freeBufferList = tp->next;
@ -6521,7 +6519,7 @@ FetchData_RXStyle(Volume *volptr,
ihP = targetptr->handle;
fdP = IH_OPEN(ihP);
if (fdP == NULL) return EIO;
optSize = AFSV_BUFFERSIZE;
optSize = sendBufSize;
tlen = FDH_SIZE(fdP);
if (tlen < 0) {
FDH_CLOSE(fdP);
@ -6799,7 +6797,7 @@ StoreData_RXStyle(Volume *volptr,
TM_GetTimeOfDay(&StartTime, 0);
optSize = AFSV_BUFFERSIZE;
optSize = sendBufSize;
/* truncate the file iff it needs it (ftruncate is slow even when its a noop) */
if (FileLength < DataLength) FDH_TRUNC(fdP, FileLength);

View File

@ -163,7 +163,7 @@ struct CallBack {
unsigned short spare; /* make it a multiple of 32 bits. */
} *CB; /* Don't use CB[0] */
/* status bits for status field of CallBack structure */
/* status values for status field of CallBack structure */
#define CB_NORMAL 1 /* Normal call back */
#define CB_DELAYED 2 /* Delayed call back due to rpc problems.
The call back entry will be added back to the

View File

@ -165,6 +165,7 @@ int buffs = 90; /* 70 */
int novbc = 0; /* Enable Volume Break calls */
int busy_threshold = 600;
int udpBufSize = 0; /* UDP buffer size for receive*/
int sendBufSize = 16384; /* send buffer size */
struct timeval tp;
@ -581,6 +582,7 @@ static void FlagMsg()
strcat(buffer, "[-k <stack size>] ");
strcat(buffer, "[-realm <Kerberos realm name>] ");
strcat(buffer, "[-udpsize <size of socket buffer in bytes>] ");
strcat(buffer, "[-sendsize <size of send buffer in bytes>] ");
/* strcat(buffer, "[-enable_peer_stats] "); */
/* strcat(buffer, "[-enable_process_stats] "); */
strcat(buffer, "[-help]\n");
@ -833,6 +835,19 @@ static int ParseArgs(int argc, char *argv[])
else
udpBufSize = bufSize;
}
else
if ( !strcmp(argv[i], "-sendsize")) {
if ( (i+1) >= argc ) {
printf("You have to specify -sendsize <integer value>\n");
return -1;
}
bufSize = atoi(argv[++i]);
if ( bufSize < 16384 )
printf("Warning:sendsize %d is less than minimum %d; ignoring\n",
bufSize, 16384);
else
sendBufSize = bufSize;
}
else
if (!strcmp(argv[i], "-enable_peer_stats")) {
rx_enablePeerRPCStats();

View File

@ -0,0 +1 @@
extern int sendBufSize;