[sclug] performance puzzle

Tom Dawes-Gamble tmdg at weardale.cl
Sat Jul 9 11:15:07 UTC 2005


On Wed, 2005-01-19 at 22:57 +0000, Tom Dawes-Gamble wrote:
> Hi
> 
> Here is an interesting situation.
> 
> # time dd if=/mnt/tmp/foo of=/dev/null bs=1024 
> 1048577+0 records in
> 1048577+0 records out
> 
> real    0m8.793s
> user    0m2.346s
> sys     0m6.422s
> # time dd if=/mnt/tmp/foo of=/mnt/tmp/bar bs=1024
> 1048577+0 records in
> 1048577+0 records out
> 
> real    0m27.614s
> user    0m3.117s
> sys     0m14.983s
> # time dd if=/mnt/tmp/bar of=/mnt/tmp/baz bs=1024
> 1048577+0 records in
> 1048577+0 records out
> 
> real    0m54.358s
> user    0m3.076s
> sys     0m14.857s
> # for i in /mnt/tmp/???
> > do
> > time md5sum $i
> > done
> 4763dafae2d293e98b62979a00308158  /mnt/tmp/bar
> 
> real    0m21.199s
> user    0m3.679s
> sys     0m2.155s
> 4763dafae2d293e98b62979a00308158  /mnt/tmp/baz
> 
> real    0m21.194s
> user    0m3.667s
> sys     0m2.163s
> 4763dafae2d293e98b62979a00308158  /mnt/tmp/foo
> 
> real    0m5.770s
> user    0m3.685s
> sys     0m2.005s
> # ll /mnt/tmp/???
> -rw-r--r--  1 root root 1073742848 Jan 19 16:33 /mnt/tmp/bar
> -rw-r--r--  1 root root 1073742848 Jan 19 16:34 /mnt/tmp/baz
> -rw-r--r--  1 root root 1073742848 Jan 19 16:31 /mnt/tmp/foo
> 
> 
> Why does foo perform so much better than bar or baz?

I didn't ever get a correct answer to this little puzzle I set in
January.  A number of people did offer the 'disk fragmentation' solution
but that is not the case here.

To add a little more information.

The system has 1 Gig of ram.
The file system is an ext3 file system. 
The file system was created mounted and then the program that originally
creates foo was run. The system was then rebooted so that no data would
be in the buffer cache. The file system was remounted and the commands
above run.

So why do the files bar and baz perform so badly?

tom.


-- 
There are 10 types of people in the world.
Those that understand Binary and those that don't.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.tmdg.co.uk/pipermail/sclug/attachments/20050709/6cc07a2d/attachment.bin


More information about the Sclug mailing list