On Sat, 29 Nov 2008 12:23:23 +0200 Alan McKinnon <[EMAIL PROTECTED]> wrote:
> On Saturday 29 November 2008 11:19:47 Daniel Iliev wrote: > > Now let's put the assumptions aside and do a test. > > > > [EMAIL PROTECTED] # test $ cat /usr/portage/packages/All/* > test1 > > [EMAIL PROTECTED] # test $ cp test1 test2 > > [EMAIL PROTECTED] # test $ ls -lah > > total 2.3G > > drwxr-xr-x 2 root users 4.0K 2008-11-29 01:38 . > > drwxr-xr-x 44 root users 4.0K 2008-11-29 01:36 .. > > -rw-r--r-- 1 root users 1.2G 2008-11-29 01:38 test1 > > -rw-r--r-- 1 root users 1.2G 2008-11-29 01:40 test2 > > localhost test # filefrag * > > test1: 1125 extents found, perfection would be 10 extents > > test2: 1923 extents found, perfection would be 10 extents > > localhost test # time cat test1 > /dev/null > > > > real 0m26.747s > > user 0m2.110s > > sys 0m1.450s > > localhost test # time cat test2 > /dev/null > > > > real 0m29.825s > > user 0m1.780s > > sys 0m1.690s > > This is not a test unfortunately. You did one run on one file and one > run on another file. We do not know what else the machine was doing > at that time, and that unknown is a considerable one. > This result is from the last of three repetitions. Its values were in the middle (not average). The deviations were in the range 1 to 1.5 seconds. Every time reading the more fragmented was slower. The system was idle in level 3, no X running. I used iostat before the tests and it registered several tens of KBs written for 1 min before the test. Compared to the size of the test files and the speed of the disk it is insignificant. > Repeat your test eliminating this factor. Preferably, remount the > filesystems after each run and repeat 1000 times. Then analyze the > statistical distribution of your results. This should eliminate most > random factors and give a more realistic real-world view. > I'm not willing to waste time for 1000 repetitions, but why don't you do the test yourself just a couple of times and see if there will be a case when the more fragmented file gets read faster? Actually my results are a little lower than what I expected but enough for me to say that fragmentation matters. At least until proved otherwise. Fragmentation leads to seeks. The average seek time on modern disks is several milliseconds. Yes, there are algorithms reordering the I/O requests to minimize the seek penalty, but still seeks are there and they hurt performance. -- Best regards, Daniel