Skip to contentSkip to conversation

ReiserFS slow, need help diagnosing

DISCUSSION Juergen Starek 5 participants 11 messages Jun 5, 2006

lore
Share & tools
lore
#0 lore raw

Hello everyone,

I hope this is the right mailing list for my question, if not, please redirect me.

I have noticed that if I put my ~ on a ReiserFS partition, Pan (GNOME's newsreader) starts very slowly, taking about 75 seconds. If I move the same article cache onto an ext3 partition, Pan starts in less than 10 seconds. This confuses me, as I've read a lot of benchmarks and comments on the net which indicate that ReiserFS is faster than ext3 when handling lots of small files.

Pan's article cache consists of lots of small files (approx. 70 MB, each file has only a few kilobytes) and, on my system, it should not be fragmented too much because I copied the files from an external source onto the empty volume.

Asking this question on the German Linux newsgroup de.comp.os.unix.linux.misc[1] didn't lead to any hints about diagnosing this behaviour. Any ideas?

Many thanks in advance

Jürgen

[1]
http://groups.google.de/group/de.comp.os.unix.linux.misc/browse_thread/thread/d60014be503abebd/

#1 lore raw

Hello

Quoted 12 lines · Juergen Starek

Hello everyone,

I hope this is the right mailing list for my question, if not, please redirect me.

I have noticed that if I put my ~ on a ReiserFS partition, Pan (GNOME's newsreader) starts very slowly, taking about 75 seconds. If I move the same article cache onto an ext3 partition, Pan starts in less than 10 seconds. This confuses me, as I've read a lot of benchmarks and comments on the net which indicate that ReiserFS is faster than ext3 when handling lots of small files.

Quoted 5 lines

Pan's article cache consists of lots of small files (approx. 70 MB, each file has only a few kilobytes) and, on my system, it should not be fragmented too much because I copied the files from an external source onto the empty volume.

Probably Pan is stat(2)-ing whole cache. Can you please try to find out what Pan is doing on start? Strace(1) may help.
If Pan is doing millions of stats for files from cache - that explains why it starts slowly when cache is stored on reiserfs.

Quoted 12 lines

Asking this question on the German Linux newsgroup de.comp.os.unix.linux.misc[1] didn't lead to any hints about diagnosing this behaviour. Any ideas?

Many thanks in advance

Jürgen

[1]
http://groups.google.de/group/de.comp.os.unix.linux.misc/browse_thread/thread/d60014be503abebd/

#2 lore raw
Quoted 7 lines · Vladimir V. Saveliev
Quoted 2 lines · Juergen Starek

I have noticed that if I put my ~ on a ReiserFS partition, Pan (GNOME's newsreader) starts very slowly, [...]

Probably Pan is stat(2)-ing whole cache. Can you please try to find out what Pan is doing on start? Strace(1) may help.

You're right, I straced Pan's start process and after initialization, it seems to call stat64 on every message in its cache. This is a snippet of the trace, produced on an ext3 filesystem (line length exceeds 80 chars):

==========
stat64("/home/jstarek/.pan/gmane", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64("/home/jstarek/.pan/Standard", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

stat64("/home/jstarek/.pan/messages/cache", {st_mode=S_IFDIR|0755, st_size=1032192, ...}) = 0 open("/home/jstarek/.pan/messages/cache", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6
fstat64(6, {st_mode=S_IFDIR|0755, st_size=1032192, ...}) = 0
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
getdents64(6, /* 62 entries */, 4096) = 4096
stat64("/home/jstarek/.pan/messages/cache/[email protected]", {st_mode=S_IFREG|0644, st_size=1426, ...}) = 0
time(NULL) = 1149517138
==========

The last two calls of this trace snippet are then repeated for all files in the cache.

Quoted 2 lines

If Pan is doing millions of stats for files from cache - that explains why it starts slowly when cache is stored on reiserfs.

Could you please explain this? An URL with the explanation is fine, too -- I just don't have experience with file systems...

Thanks,

Jürgen

#3 lore raw

Hello

Quoted 26 lines · Juergen Starek
Quoted 7 lines · Vladimir V. Saveliev
Quoted 2 lines · Juergen Starek

I have noticed that if I put my ~ on a ReiserFS partition, Pan (GNOME's newsreader) starts very slowly, [...]

Probably Pan is stat(2)-ing whole cache. Can you please try to find out what Pan is doing on start? Strace(1) may help.

You're right, I straced Pan's start process and after initialization, it seems to call stat64 on every message in its cache. This is a snippet of the trace, produced on an ext3 filesystem (line length exceeds 80 chars):

==========
stat64("/home/jstarek/.pan/gmane", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64("/home/jstarek/.pan/Standard", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

stat64("/home/jstarek/.pan/messages/cache", {st_mode=S_IFDIR|0755, st_size=1032192, ...}) = 0 open("/home/jstarek/.pan/messages/cache", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6
fstat64(6, {st_mode=S_IFDIR|0755, st_size=1032192, ...}) = 0
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
getdents64(6, /* 62 entries */, 4096) = 4096
stat64("/home/jstarek/.pan/messages/cache/[email protected]", {st_mode=S_IFREG|0644, st_size=1426, ...}) = 0
time(NULL) = 1149517138
==========

Quoted 9 lines

The last two calls of this trace snippet are then repeated for all files in the cache.

Quoted 2 lines

If Pan is doing millions of stats for files from cache - that explains why it starts slowly when cache is stored on reiserfs.

Could you please explain this? An URL with the explanation is fine, too -- I just don't have experience with file systems...

reiserfs does not store inodes as compact as ext3. It allocates inodes dynamically. As result reiserfs inodes get spread over whole filesystem. Also reiserfs tries to store file bodies in the same block as file's inode. As result one reiserfs block usually contains inodes than ext[23] inode block does.
So, to stat each file of directory reiserfs has to perform more disk reads and to do more disk head seek than a filesystem which stores inodes compactly in preallocated disk area.

Quoted 5 lines

Thanks,

Jürgen

#4 lore raw
Quoted 8 lines · Vladimir V. Saveliev

reiserfs does not store inodes as compact as ext3. It allocates inodes dynamically. As result reiserfs inodes get spread over whole filesystem. Also reiserfs tries to store file bodies in the same block as file's inode. As result one reiserfs block usually contains inodes than ext[23] inode block does.
So, to stat each file of directory reiserfs has to perform more disk reads and to do more disk head seek than a filesystem which stores inodes compactly in preallocated disk area.

Is this performance problem with stat heavy load fixed in Reiser4?

Thanks,

Grzegorz Kulewski

#5 lore raw

Hello

Quoted 10 lines · Grzegorz Kulewski
Quoted 8 lines · Vladimir V. Saveliev

reiserfs does not store inodes as compact as ext3. It allocates inodes dynamically. As result reiserfs inodes get spread over whole filesystem. Also reiserfs tries to store file bodies in the same block as file's inode. As result one reiserfs block usually contains inodes than ext[23] inode block does.
So, to stat each file of directory reiserfs has to perform more disk reads and to do more disk head seek than a filesystem which stores inodes compactly in preallocated disk area.

Quoted 2 lines

Is this performance problem with stat heavy load fixed in Reiser4?

Well, inode location in reiser4 changed comparing to reiserfs. reiser4 groups inodes of files of one directory together (reiserfs did not do that), but still allocated disk space for inodes dynamically as reiserfs.
So, I guess that reiser4 will be better than reiserfs, but still worse than ext[23]. Would you verify this guess it please?

Quoted 6 lines

Thanks,

Grzegorz Kulewski

#6 lore raw
Quoted 16 lines · Vladimir V. Saveliev

Hello

Quoted 10 lines · Grzegorz Kulewski
Quoted 8 lines · Vladimir V. Saveliev

reiserfs does not store inodes as compact as ext3. It allocates inodes dynamically. As result reiserfs inodes get spread over whole filesystem. Also reiserfs tries to store file bodies in the same block as file's inode. As result one reiserfs block usually contains inodes than ext[23] inode block does.
So, to stat each file of directory reiserfs has to perform more disk reads and to do more disk head seek than a filesystem which stores inodes compactly in preallocated disk area.

Quoted 2 lines

Is this performance problem with stat heavy load fixed in Reiser4?

Quoted 6 lines

Well, inode location in reiser4 changed comparing to reiserfs. reiser4 groups inodes of files of one directory together (reiserfs did not do that), but still allocated disk space for inodes dynamically as reiserfs.
So, I guess that reiser4 will be better than reiserfs, but still worse than ext[23]. Would you verify this guess it please?

I currently have no Reiser4 filesystem and no disk space to make one due to two recent big disk hardware failures. But I will buy some disks in about two months and I will try to experiment with Reiser4 again.

I (still) hope that Reiser4 will be included in mainline (more or less) soon...

Thanks,

Grzegorz Kulewski

#7 lore raw
Quoted 9 lines · Grzegorz Kulewski
Quoted 8 lines

Well, inode location in reiser4 changed comparing to reiserfs. reiser4 groups inodes of files of one directory together (reiserfs did not do that), but still allocated disk space for inodes dynamically as reiserfs.
So, I guess that reiser4 will be better than reiserfs, but still worse than ext[23]. Would you verify this guess it please?

I wouild not assume this. There is a huge difference with respect to this usage pattern between reiser4 and reiser3, it should dramatically improve. I don't know if we will be better or worse than ext3, it could be either, best to measure it.

#8 lore raw
Quoted 11 lines · Hans Reiser
Quoted 9 lines · Grzegorz Kulewski
Quoted 8 lines

Well, inode location in reiser4 changed comparing to reiserfs. reiser4 groups inodes of files of one directory together (reiserfs did not do that), but still allocated disk space for inodes dynamically as reiserfs.
So, I guess that reiser4 will be better than reiserfs, but still worse than ext[23]. Would you verify this guess it please?

Quoted 4 lines

I wouild not assume this. There is a huge difference with respect to this usage pattern between reiser4 and reiser3, it should dramatically improve. I don't know if we will be better or worse than ext3, it could be either, best to measure it.

I also use Pan, and recently switched to using Reiser4 on my laptop. I can tell that Pan starts much more quickly than it used to using Reiser3. It isn't nearly as fast as starting it from a USB Flash drive though. I don't know how it compares to ext3, although the flash drive was using a ext2 loopback on FAT-32 filesystem.

Signature · 2 lines
Jonathan Briggs <[email protected]>
eSoft, Inc.
#9 lore raw
In reply to Hans Reiser
Quoted 7 lines · Hans Reiser
Quoted 3 lines
Quoted 2 lines

So, I guess that reiser4 will be better than reiserfs, but still worse than ext[23]. Would you verify this guess it please?

I wouild not assume this. There is a huge difference with respect to this usage pattern between reiser4 and reiser3, it should dramatically improve. I don't know if we will be better or worse than ext3, it could be either, best to measure it.

Well, thanks to all of you for helping me with this. Once I get my hands on a test system (and have enough free time), I'll try to test various file systems with this scenario.

Regards,

Jürgen

#10 lore raw
In reply to Vladimir V. Saveliev
Quoted 3 lines · Vladimir V. Saveliev

As result one reiserfs block usually contains

fewer

Quoted 20 lines

inodes than ext[23]
inode block does.
So, to stat each file of directory reiserfs has to perform more disk reads and to do more disk head seek than a filesystem which stores inodes compactly in preallocated disk area.

Quoted 7 lines

Thanks,

Jürgen