Re: [STUPID TESTCASE] ext3 htree vs. reiserfs on 2.5.40-mm1

Daniel Phillips
2002-10-01T21:22:05Z

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

On Tuesday 01 October 2002 21:59, Paul P Komkoff Jr wrote:
> This is the stupidiest testcase I've done but it worth seeing (maybe)
>
> We create 300000 files

How big are the files?

> named from 00000000 to 000493E0 in one directory, then delete it in order.

You probably want to try creating the files in random order as well. A
program to do that is attached, use in the form:

randfiles <basename> <count> y

where 'y' means 'print the names', for debugging purposes.

What did your delete command look like, "rm -rf" or "echo * | xargs rm"?

> Tests taken on ext3+htree and reiserfs. ext3 w/o htree hadn't
> evaluated because it will take long long time ...
>
> both filesystems was mounted with noatime,nodiratime and ext3 was
> data=writeback to be somewhat fair ...
>
> real user sys
> reiserfs:
> Creating: 3m13.208s 0m4.412s 2m54.404s
> Deleting: 4m41.250s 0m4.206s 4m17.926s
>
> Ext3:
> Creating: 4m9.331s 0m3.927s 2m21.757s
> Deleting: 9m14.838s 0m3.446s 1m39.508s
>
> htree improved this a much but it still beaten by reiserfs. seems odd
> to me - deleting taking twice time then creating ...

Only 300,000 files, you haven't got enough to cause inode table thrashing,
though some kernels shrink the inode cache too agressively and that can
cause thrashing at lower numbers. Maybe a bottleneck in the journal?

Not that anybody is going to complain about any of the above - it's still
running less than 1 ms/create, 2 ms/delete. Still, it's slower than I'm
used to.

--
Daniel

[-- Attachment #2: randfiles.c --]
[-- Type: text/x-c, Size: 539 bytes --]

#include <stdlib.h>

#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)

int main (int argc, char *argv[])
{
int n = (argc > 2)? strtol(argv[2], 0, 10): 0;
int i, size = 50, show = argc > 3 && !strncmp(argv[3], "y", 1);
char name[size];
int choose[n];

for (i = 0; i < n; i++) choose[i] = i;
for (i = n; i; i--) swap(choose[i-1], choose[rand() % i]);
for (i = 0; i < n; i++)
{
snprintf(name, size, "%s%i", argv[1], choose[i]);
if (show) printf("create %s\n", name);
close(open(name, 0100));
}
return 0;
}