Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 1995 10:00:34 -0600 (CST)
From:      Joe Greco <jgreco@brasil.moneng.mei.com>
To:        dyson@freefall.freebsd.org (John Dyson)
Cc:        current@freebsd.org
Subject:   Re: ISP state their FreeBSD concerns
Message-ID:  <199511121600.KAA26310@brasil.moneng.mei.com>
In-Reply-To: <199511120557.VAA24917@freefall.freebsd.org> from "John Dyson" at Nov 11, 95 09:57:36 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > 8.	File creation (particularly directories) appears to be slow compared
> > 	to other BSD-like systems.  They say the stats for INN and CNEWS
> > 	for articles processed per second are quite a bit lower than that
> > 	on some "other" systems.  They say that file deletion seems to be
> > 	a bit slower than BSDI, but not by much.  I think they are talking
> > 	2.0.5 on this item, although one ISP was experimenting with 1026 SNAP.
> 
> I am working on this stuff right now.  Give me benchmarks!!!!  I'll
> do what I can.

:-(

I have a little suite of programs I use for performance testing.  The tests
are absolutely slanted towards news server type applications.  The one in
particular I will quote is "small-file-write.c", a program that writes 10000
files in subdirectories, creating the subdirectories if needed (much like a
news server would do).  So the "first run" numbers include the time needed
to make dirs:

Slowaris 5.4 - SS10/30 - 64MB RAM (SCSI II, reasonable drive)

10000 files in 332 seconds - first run
10000 files in 20 !!! seconds - second run

Slowaris 5.4 - SS10/30 - 64MB RAM (SCSI II, Barracuda drive)

10000 files in 249 seconds - first run
10000 files in 13 !!! seconds - second run

Slowaris 5.4 - SS10/30 - 64MB RAM - PrestoServe (SCSI II, Barracuda drive)

10000 files in 76 seconds - first run
10000 files in 12 seconds - second run

FreeBSD 2.0.5R - ASUS SP3G AMD 486DX2/66 + NCR810 - 8MB (SCSI II, reasonable
drive)

10000 files in 620 seconds - first run  :-(  :-(
10000 files in 310 seconds - second run  :-( :-( :-( !!

FreeBSD 1026-SNAP - ASUS SP3G AMD 486DX4/100 + NCR810 - 48MB (SCSI II, SLOW
drive, fs mounted -o async)

10000 files in 569 seconds - first run  :-(  :-(
10000 files in 207 seconds - second run  :-( :-( :-( !!

Now, I can't swear that by tweaking newfs options, etc., it isn't able to
improve this - I simply haven't tried because I didn't realize until just
now how abominable this performance was.  Does anybody have advice about
what might be tweakable to help this?  This is really sad.

The program itself:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>

char *pathn(int x)
{
	static char *buffer[1024];
	int d1, d2, d3;

	d1 = x;
	x /= 10;
	d1 -= x * 10;
	d2 = x;
	x /= 10;
	d2 -= x * 10;
	d3 = x;
	x /= 10;
	d3 -= x * 10;
	sprintf(buffer, "%d/%d/%d/%d", d1, d2, d3, x);
	return(buffer);
}





int writef(char *name)
{
	int fd;
	char *ptr;

	if ((fd = open(name, O_CREAT|O_RDWR, 0644)) < 0) {
		if (errno == ENOENT) {
			ptr = name;
			while (ptr = strchr(ptr, '/')) {
				*ptr = '\0';
				if (mkdir(name, 0755) < 0) {
					if (errno != EEXIST) {
						perror(name);
						exit(1);
					}
				}
				*ptr++ = '/';
			}
			return(writef(name));
		} else {
			perror(name);
			exit(1);
		}
	} else {
		close(fd);
	}
}





int main()
{
	int i, n;
	time_t tm = time(NULL);
	n = 10000;

	for (i = 0; i < n; i++) {
		writef(pathn(i));
		if (! (i % 100)) {
			printf("%d..", i);
			fflush(stdout);
		}
	}
	printf("\n%d files in %d seconds\n", n, time(NULL) - tm);
	exit(0);
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511121600.KAA26310>