large files
Hello,
I'm currently testing our new server and though it will primarily not serve really large files (about 40-60 users will have a quota of 25GB each on a 2TB array), I'm still testing the performance for large files.
So I created an about 300GB fil and the problem is to remove it now. Removing it took much more than 15 minutes. Here's the the relevant top line:
5012 root 18 0 368 368 312 D 21.9 0.0 5:48 rm
Since I didn't expect it to take so much time, I didn't measure the time to delete this file.
system specifications:
- dual opteron 242 (1600 MHz)
- linux-2.4.26 with all patches from Chris, no further patches
- reiserfs-3.6 format
The partition with the 300GB file has a size of 1.7TB.
Any ideas whats going on?
Thanks,
Bernd
Signature · 6 lines
Bernd Schubert Physikalisch Chemisches Institut / Theoretische Chemie Universität Heidelberg INF 229 69120 Heidelberg e-mail: [email protected]
Quoted 14 lines · Bernd Schubert
Hello,
I'm currently testing our new server and though it will primarily not serve really large files (about 40-60 users will have a quota of 25GB each on a 2TB array), I'm still testing the performance for large files.
So I created an about 300GB fil and the problem is to remove it now. Removing it took much more than 15 minutes. Here's the the relevant top line:
5012 root 18 0 368 368 312 D 21.9 0.0 5:48 rm
Since I didn't expect it to take so much time, I didn't measure the time to delete this file.
Quoted 6 lines
system specifications:
- dual opteron 242 (1600 MHz)
- linux-2.4.26 with all patches from Chris, no further patches
- reiserfs-3.6 formatThe partition with the 300GB file has a size of 1.7TB.
This is most likely a combination of metadata fragmentation and the fact that during deletes, 2.4.x reiserfs ends up reading one block at a time.
As a comparison data point, could you please try 2.6.6-mm3? I realize you don't want to run this kernel in production, but it would tell us if I understand the problems at hand.
-chris
Quoted 3 lines
As a comparison data point, could you please try 2.6.6-mm3? I realize you don't want to run this kernel in production, but it would tell us if I understand the problems at hand.
I will do this during the next days. Currently the system is not running in production yet, so rebooting other kernel versions is no problem.
Thanks,
Bernd
Signature · 6 lines
Bernd Schubert Physikalisch Chemisches Institut / Theoretische Chemie Universität Heidelberg INF 229 69120 Heidelberg e-mail: [email protected]
Hello Chris,
Quoted 4 lines
As a comparison data point, could you please try 2.6.6-mm3? I realize you don't want to run this kernel in production, but it would tell us if I understand the problems at hand.
the results in 2.6.6-mm3 are below, we almost consider to run this kernel version.
Here are two other interesting facts:
1.) During the filecreation in 2.4.26 the load on the system was around 3-4, whereas in 2.6.6-mm3 the load was at about 8-9.
2.) When the dd file creation process finished (2.4.26 was running) the system became so unresponsible, that the drdb connection timed out and a resync process automatically started when the system became responsible again. I don't have any comparism to 2.6.6-mm3 since we would need another drbd version. Also, I don't know if this happend when dd finished or when rm-started, since both were running from a script.
Here are the measured times for file creation and file deleting
=====> 2.4.26:
taylor:~# cat test.out-2.4.26 time dd if=/dev/zero of=/worka/testfile.dd bs=1M count=300000 300000+0 records in 300000+0 records out 314572800000 bytes transferred in 5746.266841 seconds (54743855 bytes/sec)
real 95m46.275s
user 0m0.760s
sys 29m57.800s
time rm -fr /worka/testfile.dd
real 11m20.589s
user 0m0.000s
sys 4m59.850s
=====> 2.6.6-mm3
taylor:~# cat test.out-2.6.6-mm3 time dd if=/dev/zero of=/worka/testfile.dd bs=1M count=300000 300000+0 records in 300000+0 records out 314572800000 bytes transferred in 4902.873869 seconds (64160900 bytes/sec)
real 81m46.211s
user 0m1.172s
sys 22m26.010s
time rm -fr /worka/testfile.dd
real 1m38.000s
user 0m0.000s
sys 1m5.872s
Do you have any ideas how we could improve 2.4.x?
Thanks,
Bernd
Signature · 6 lines
Bernd Schubert Physikalisch Chemisches Institut / Theoretische Chemie Universität Heidelberg INF 229 69120 Heidelberg e-mail: [email protected]
Quoted 7 lines · Bernd Schubert
Hello Chris,
Quoted 4 lines
As a comparison data point, could you please try 2.6.6-mm3? I realize you don't want to run this kernel in production, but it would tell us if I understand the problems at hand.
Quoted 8 lines
the results in 2.6.6-mm3 are below, we almost consider to run this kernel version.
Here are two other interesting facts:
1.) During the filecreation in 2.4.26 the load on the system was around 3-4, whereas in 2.6.6-mm3 the load was at about 8-9.
Which procs contributed to this load? The simple dd should have kept the load at one.
Quoted 7 lines
2.) When the dd file creation process finished (2.4.26 was running) the system became so unresponsible, that the drdb connection timed out and a resync process automatically started when the system became responsible again. I don't have any comparism to 2.6.6-mm3 since we would need another drbd version. Also, I don't know if this happend when dd finished or when rm-started, since both were running from a script.
Probably the rm.
[ 2.6.6-mm3 is much faster ]
Quoted 2 lines
Do you have any ideas how we could improve 2.4.x?
2.6.6-mm has a few key improvements. There's less metadata fragmentation thanks to some block allocator fixes. More importantly, during the rm, metadata blocks are read in 16 at a time instead of 1 at a time. I'd be happy to give someone pointers on porting the metadata readahead bits back to 2.4.
-chris
Quoted 5 lines
Quoted 2 lines
1.) During the filecreation in 2.4.26 the load on the system was around 3-4, whereas in 2.6.6-mm3 the load was at about 8-9.
Which procs contributed to this load? The simple dd should have kept the load at one.
Thats all I can see from top (2.4.26):
top - 16:45:14 up 4:47, 1 user, load average: 3.30, 2.80, 2.09
Tasks: 80 total, 1 running, 79 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0% user, 24.0% system, 0.0% nice, 76.0% idle Mem: 3104428k total, 3018816k used, 85612k free, 228936k buffers Swap: 1951888k total, 0k used, 1951888k free, 2662272k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1043 root 19 0 1392 364 320 D 40.7 0.0 3:11.55 dd 7 root 9 0 0 0 0 D 3.7 0.0 4:02.48 kupdated 6 root 9 0 0 0 0 D 1.7 0.0 2:15.18 bdflush 5 root 9 0 0 0 0 S 1.0 0.0 2:47.13 kswapd
17 root 9 0 0 0 0 D 0.3 0.0 0:46.62 kreiserfsd
1052 root 9 0 1040 1040 820 R 0.3 0.0 0:00.02 top
taylor:~# cat /proc/stat cpu 402 0 538233 2938065 cpu0 221 0 267698 1470431 cpu1 181 0 270535 1467634 page 215506778 453499588 swap 1 0 intr 200179775 1738350 2 0 9 4 0 2 0 4 2 0 0 0 0 13 5 0 0 0 0 0 0 0 0 5017728 187006 0 0 0 193236650 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 disk_io: (3,0):(4,4,32,0,0) (8,0): (5058268,3638518,431013524,1419750,906999184) ctxt 179608469 btime 1084874257 processes 1054
Unfortunality I even don't have an idea how to interprete those numbers.
Quoted 7 lines
Quoted 1 line
Do you have any ideas how we could improve 2.4.x?
2.6.6-mm has a few key improvements. There's less metadata fragmentation thanks to some block allocator fixes. More importantly, during the rm, metadata blocks are read in 16 at a time instead of 1 at a time. I'd be happy to give someone pointers on porting the metadata readahead bits back to 2.4.
I certainly have neither the knowledge nor the time to do that.
Cheers,
Bernd
Quoted 2 lines · Bernd Schubert
Unfortunality I even don't have an idea how to interprete those numbers.
Well, on 2.6, you've got one or more pdflush daemons that might contribute to the load as well.
Quoted 11 lines
Quoted 8 lines
Quoted 2 lines
Do you have any ideas how we could improve 2.4.x?
2.6.6-mm has a few key improvements. There's less metadata fragmentation thanks to some block allocator fixes. More importantly, during the rm, metadata blocks are read in 16 at a time instead of 1 at a time. I'd be happy to give someone pointers on porting the metadata readahead bits back to 2.4.
I certainly have neither the knowledge nor the time to do that.
I'd suggest contacting namesys. Really all the patch needs is some reject / fuzz resolution and testing.
-chris
Quoted 29 lines · Chris Mason
Quoted 4 lines · Bernd Schubert
Unfortunality I even don't have an idea how to interprete those numbers.
Well, on 2.6, you've got one or more pdflush daemons that might contribute to the load as well.
Quoted 14 lines
Quoted 10 lines
Quoted 3 lines
Do you have any ideas how we could improve 2.4.x?
2.6.6-mm has a few key improvements. There's less metadata fragmentation thanks to some block allocator fixes. More importantly, during the rm, metadata blocks are read in 16 at a time instead of 1 at a time. I'd be happy to give someone pointers on porting the metadata readahead bits back to 2.4.
I certainly have neither the knowledge nor the time to do that.
Quoted 10 lines
I'd suggest contacting namesys. Really all the patch needs is some reject / fuzz resolution and testing.
-chris
Patch? Tell me more please.;-)
Quoted 6 lines · Hans Reiser
Quoted 3 lines
I'd suggest contacting namesys. Really all the patch needs is some reject / fuzz resolution and testing.
Patch? Tell me more please.;-)
;-) I believe the slow down during rm comes from prepare_for_delete_or_cut reading in one btree leaf at a time. I changed the (previously disabled) btree readahead code to automatically do readahead for directory reads and unlinks. I think I've got this solved in 2.6.x reiserv3, Bernd needs it against 2.4.x + data logging.
In the directory read case, it does forward looking readahead, meaning that when you read offset N in the object, it assumes you're going to next read offset N+1.
For unlinks, it does backwards looking readahead. If you read offset N in the object, it assumes you're going to next read offset N-1. This is because we delete bytes in a file starting from the last byte and keep decrementing until the file is empty. You should be able to increase performance further by doing readahead in 32 or 64 block chunks instead of 16.
The patch is attached. This one was in 2.6.6-mm3, but the 2.4.x data logging code is fairly close to 2.6.6, especially code outside fs/reiserfs/journal.c
-chris
From: Chris Mason <[email protected]>
Walking the btree can trigger a number of single block synchronous reads. This patch does btree readahead during operations that are likely to be long and sequential. So far, that only includes directory reads and truncates, but it can make both much faster.
---
25-akpm/fs/reiserfs/dir.c | 1 25-akpm/fs/reiserfs/stree.c | 93 ++++++++++++++++++++++++++---------- 25-akpm/include/linux/reiserfs_fs.h | 6 +- 3 files changed, 74 insertions(+), 26 deletions(-)
fs/reiserfs/dir.c renamed from fs/reiserfs/dir.c~reiserfs-search_reada-5 +1 -0
@@ -64,6 +64,7 @@ static int reiserfs_readdir (struct file/* reiserfs_warning (inode->i_sb, "reiserfs_readdir 1: f_pos = %Ld", filp->f_pos);*/ + path_to_entry.reada =PATH_READA ;while (1 ) { research:/* search the directory item, containing entry with specified key */
fs/reiserfs/stree.c renamed from fs/reiserfs/stree.c~reiserfs-search_reada-5 +68 -25
136 lines not on this page · raw message
include/linux/reiserfs_fs.h renamed from include/linux/reiserfs_fs.h~reiserfs-search_reada-5 +5 -1
@@ -1238,8 +1238,12 @@ excessive effort to avoid disturbing thegods only know how we are going to SMP the code that uses them. znodes are the way! */ +#define PATH_READA 0x1/* do read ahead */ +#define PATH_READA_BACK 0x2/* read backwards */ +struct path {int path_length;/* Length of the array above. */ +int reada;struct path_element path_elements[EXTENDED_MAX_HEIGHT ];/* Array of the path elements. */ int pos_in_item; };
@@ -1247,7 +1251,7 @@ struct path {#define pos_in_item (path) ((path)->pos_in_item)#define INITIALIZE_PATH (var) \ -struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET,} +struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}/* Get path element by path and path position. */ #define PATH_OFFSET_PELEMENT (p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset))
_