Re: [netatalk-admins] Adrian's afpd server not letting go?


Subject: Re: [netatalk-admins] Adrian's afpd server not letting go?
From: Andras Kadinger (bandit@freeside.elte.hu)
Date: Wed Mar 11 1998 - 11:14:16 EST


a sun wrote:
> it's already in my current, unavailable snaphost. that snapshot has a
> few tweaks to improve solaris support. i'll probably make it available
> after i've added in my opendir/readdir/closedir version of
> case-insensitive file comparisons.
>
> actually, i would really like some data on the standard size of
> people's directories and the machines they're running on. currently,
> the only way of properly doing case-insensitive lookups that i can
> think of is to actually read the directories, making it an O(n)
> operation. bleah. that can be sped up somewhat for future directory
> reads by maintaining a hashed list or something. however, that's only
> a win if you can be sure that the files won't do something unexpected
> under you. i don't think we can make that guarantee with
> netatalk. ideas anyone?

I've done some measurements with the routine I sent You before, on a
P133/16MB with Linux 2.0.33.

Empty directory, creat(3)-ing 5000 files:

bash$ time ../catalog -c 5000
0.16user 27.51system 0:29.28elapsed 94%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

Now there are only a couple of empty files here. Let's build the catalog
file; this involves opendir/readdir/closedir, and finally writes the
resulting list to a .Catalog file in the same directory.

bash$ time ../catalog -l .
0.06user 0.69system 0:03.45elapsed 21%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

Now we created the catalog file, so next time we can read it directly
and avoid readdir. The result:

bash$ time ../catalog -l .
0.00user 0.11system 0:00.35elapsed 31%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

Something happens which I am not aware of yet, because in subsequent
invocations, we get:

bash$ time ../catalog -l .
0.00user 0.06system 0:00.07elapsed 85%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

I used the raw dirent structure:

bash$ ls -l .Catalog
-rw------- 1 bandit users 1340536 Mar 11 16:43 .Catalog

Note: most of the involved disk blocks are cached in memory; no sorting
used.

I can not think of any way a file could escape our attention if we base
the updating of the catalog on the directory->mtime > catalog->mtime
comparison modulo races, but I am not an unix expert after all.

Sincerely,
Andras Kadinger
bandit@freeside.elte.hu



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:31:27 EST