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