From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-87118-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1L6iwW-0007BY-Hw
	for garchives@archives.gentoo.org; Sun, 30 Nov 2008 09:50:20 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 32682E04AE;
	Sun, 30 Nov 2008 09:50:19 +0000 (UTC)
Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.149])
	by pigeon.gentoo.org (Postfix) with ESMTP id CAE23E04AE
	for <gentoo-user@lists.gentoo.org>; Sun, 30 Nov 2008 09:50:18 +0000 (UTC)
Received: by ey-out-1920.google.com with SMTP id 4so767402eyk.10
        for <gentoo-user@lists.gentoo.org>; Sun, 30 Nov 2008 01:50:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=X1f7dyhXoo6LzBPFG83buxzGlZOQO2VidH/z6DKNvI8=;
        b=DmVhp0Rg2nm5wXCu0C6E21dgoUTNilIHNRC8gXO+BPVkoubwtt783vUNHOyMVjW6ep
         AW7oMaa87O1XXiTX/qgjPS7G9XTu+9iNTMvPoXd3L60CeojZMN6Mn7TLQ3QUc6ove7ha
         gk6T/IEriJys81nfGuiezu2875/lY0kEFseo8=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=ZZha6D84jzahnhDDHkxkBWk76kvsz49ud8141CVtOscsFP8GgkCSRqA3yFbHYkMgBv
         hvZUa9b6FHbodnHNoHHKcte0Qj63+wMPJThOpbBcTayvh9Q4abkeWpg5n9HiCOBOUEHB
         1Zg/c2pg+IcRoTpzVVBZVxCwznp3GGLS/BPPY=
Received: by 10.103.238.4 with SMTP id p4mr3968141mur.68.1228038618052;
        Sun, 30 Nov 2008 01:50:18 -0800 (PST)
Received: by 10.103.182.12 with HTTP; Sun, 30 Nov 2008 01:50:18 -0800 (PST)
Message-ID: <ae107db90811300150i28c734f1n60b48e69e09a7a79@mail.gmail.com>
Date: Sun, 30 Nov 2008 11:50:18 +0200
From: "Daniel Iliev" <daniel.iliev@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [OT] Fragmentation of my drives. Curious mostly
In-Reply-To: <20081130114143.66288aaa@ilievnet.com>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <492FD2A2.5080301@gmail.com> <20081129110921.75a6e346@ilievnet.com>
	 <ae107db90811290119r655e8d13ud887e5bed5920e73@mail.gmail.com>
	 <200811291223.23344.alan.mckinnon@gmail.com>
	 <20081130114143.66288aaa@ilievnet.com>
X-Archives-Salt: 7fe8d451-f5c2-4407-b635-1095445db5f6
X-Archives-Hash: ec58fe0100d6f01714659bd655ba6012

On Sat, 29 Nov 2008 12:23:23 +0200
Alan McKinnon <alan.mckinnon@gmail.com> wrote:

> On Saturday 29 November 2008 11:19:47 Daniel Iliev wrote:
> > Now let's put the assumptions aside and do a test.
> >
> > root@localhost # test $ cat /usr/portage/packages/All/* > test1
> > root@localhost # test $ cp test1 test2
> > root@localhost # 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