Article View: news.software.nntp
Article #22341Re: Diablo and NFS
From: Brian Tao
Date: Tue, 14 Oct 1997 00:00
Date: Tue, 14 Oct 1997 00:00
55 lines
2426 bytes
2426 bytes
In article <61v2tp$800$1@flea.best.net>, Matt Dillon <dillon@best.net> wrote:
>
> Diablo relies very heavily on locks in core code. It makes a huge
> number of fcntl locking calls, but the code is also designed to
> avoid lock contention whenever possible.
I banged out a quick little benchmark that locks a file, appends a
few bytes to it and unlocks it. An Ultra-1 to a Netapp F210 over 10
Mbps gets about 240 loop iterations per second. The same test to the
internal 2GB drive gets about 24000 iterations per second, and about
45000 iterations per second on the /tmp memory filesystem. The
numbers to an NFS filesystem imported from an Ultra were somewhat
higher than from a Netapp, but that may be because the Netapp was busy
with other things at the time.
A fellow from GTE who had tried Diablo over NFS said his news
server was churning out 100x the number of system calls compared to
using local disk storage (although I haven't asked why yet).
#include <stdio.h>
#include <sys/file.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int filedes;
int c;
FILE *fptr;
struct flock arg;
unlink(argv[1]);
filedes = open(argv[1], O_RDWR | O_CREAT, 0644);
fptr = fdopen(filedes, "a+");
for(c=1 ; c<=10000 ; c++)
{
arg.l_type = F_WRLCK; arg.l_whence = arg.l_start = arg.l_len = 0;
fcntl(filedes, F_SETLK, &arg);
fprintf(fptr, "Wrote %d\n", c);
arg.l_type = F_UNLCK; arg.l_whence = arg.l_start = arg.l_len = 0;
fcntl(filedes, F_SETLK, &arg);
}
fclose(fptr);
close(filedes);
exit(0);
}
--
Brian Tao (BT300, taob@netcom.ca)
"Though this be madness, yet there is method in't"
Technical Details
Message-ID:
<61vu30$9pe$1@tor-nn1.netcom.ca>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<61v0d8$ka9$1@tor-nn1.netcom.ca> <61v2tp$800$1@flea.best.net>Show Full Headers
Complete Article Headers
Message-ID: <61vu30$9pe$1@tor-nn1.netcom.ca> Subject: Re: Diablo and NFS Date: Tue, 14 Oct 1997 00:00:00 +0000 From: taob@nbc.netcom.ca (Brian Tao) References: <61v0d8$ka9$1@tor-nn1.netcom.ca> <61v2tp$800$1@flea.best.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 280394028 Organization: NETCOM Canada, Toronto, Ontario, Canada NNTP-Posting-Date: 14 Oct 1997 10:03:12 EDT Newsgroups: news.software.nntp X-Newsposter: Pnews 4.0-test52 (20 Jan 97)