public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* cannot defrag volume, fragmentation factor 21.73%
@ 2010-10-18 12:09 Richard Ems
  2010-10-18 12:39 ` Michael Monnerie
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Richard Ems @ 2010-10-18 12:09 UTC (permalink / raw)
  To: xfs

Hi all,

this is on openSUSE 11.3.

# uname -a
Linux fs1 2.6.34.7-0.3-default #1 SMP 2010-09-20 15:27:38 +0200 x86_64 
x86_64 x86_64 GNU/Linux

# echo frag | xfs_db -r /dev/disk/by-label/data1
xfs_db> actual 6451844, ideal 5050129, fragmentation factor 21.73%

# xfs_db -V
xfs_db version 3.1.2

# xfs_fsr -V
xfs_fsr version 3.1.2

# df -h /dev/sdb1
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1              17T   13T  4.3T  75% /data_1


The volume is new, 12TB were rsync'ed from another volume, some new 
files came after the sync.

I ran several times xfs_fsr, but the 21.73% factor stays there.
There where some busy or modified files on which I started xfs_fsr later 
again, but this ones where small files and the 21.73% is still there.

Any ideas?

Richard


-- 
Richard Ems       mail: Richard.Ems@Cape-Horn-Eng.com

Cape Horn Engineering S.L.
C/ Dr. J.J. Dómine 1, 5º piso
46011 Valencia
Tel : +34 96 3242923 / Fax 924
http://www.cape-horn-eng.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 12:09 cannot defrag volume, fragmentation factor 21.73% Richard Ems
@ 2010-10-18 12:39 ` Michael Monnerie
  2010-10-18 13:46   ` Richard Ems
  2010-10-18 20:16 ` Stan Hoeppner
  2010-10-18 23:10 ` Dave Chinner
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Monnerie @ 2010-10-18 12:39 UTC (permalink / raw)
  To: xfs; +Cc: Richard Ems


[-- Attachment #1.1: Type: Text/Plain, Size: 594 bytes --]

On Montag, 18. Oktober 2010 Richard Ems wrote:
> I ran several times xfs_fsr, but the 21.73% factor stays there.

Possibly you have some very big files which cannot be defraged? What 
output does xfs_fsr -v give?


-- 
mit freundlichen Grüssen,
Michael Monnerie, Ing. BSc

it-management Internet Services
http://proteger.at [gesprochen: Prot-e-schee]
Tel: 0660 / 415 65 31

****** Radiointerview zum Thema Spam ******
http://www.it-podcast.at/archiv.html#podcast-100716

// Wir haben im Moment zwei Häuser zu verkaufen:
// http://zmi.at/langegg/
// http://zmi.at/haus2009/

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 12:39 ` Michael Monnerie
@ 2010-10-18 13:46   ` Richard Ems
  2010-10-18 17:58     ` Michael Monnerie
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Ems @ 2010-10-18 13:46 UTC (permalink / raw)
  To: Michael Monnerie; +Cc: xfs

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

On 10/18/2010 02:39 PM, Michael Monnerie wrote:
> On Montag, 18. Oktober 2010 Richard Ems wrote:
>> I ran several times xfs_fsr, but the 21.73% factor stays there.
>
> Possibly you have some very big files which cannot be defraged? What
> output does xfs_fsr -v give?
>
>

There are no very big files, surely some with a couple of GBs but not 
more. All files are defragmented.

Attached the gzipped output of 3 runs of xfs_fsr generated with the command:

{ set -x ; for i in 1 2 3 ; do date ; echo frag | xfs_db -r 
/dev/disk/by-label/data1 ; date ; xfs_fsr -v /data_1/ ; date ; echo frag 
| xfs_db -r /dev/disk/by-label/data1 ; date ; done ; set +x ;} > 
~/logs/defrag/data1/xfs_fsr-HOME-2010.10.18-1.log 2>&1 &


Thanks, Richard


-- 
Richard Ems       mail: Richard.Ems@Cape-Horn-Eng.com

Cape Horn Engineering S.L.
C/ Dr. J.J. Dómine 1, 5º piso
46011 Valencia
Tel : +34 96 3242923 / Fax 924
http://www.cape-horn-eng.com

[-- Attachment #2: xfs_fsr-HOME-2010.10.18-1.log.gz --]
[-- Type: application/x-gzip, Size: 218367 bytes --]

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 13:46   ` Richard Ems
@ 2010-10-18 17:58     ` Michael Monnerie
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Monnerie @ 2010-10-18 17:58 UTC (permalink / raw)
  To: xfs; +Cc: Richard Ems


[-- Attachment #1.1: Type: Text/Plain, Size: 682 bytes --]

On Montag, 18. Oktober 2010 Richard Ems wrote:
> Attached the gzipped output of 3 runs of xfs_fsr generated with the
> command:

All files reported have "after:1", so where does the fragmentation come 
from? Interesting. Maybe a umount;mount helps? Could be the info is just 
wrong until a remount?

-- 
mit freundlichen Grüssen,
Michael Monnerie, Ing. BSc

it-management Internet Services
http://proteger.at [gesprochen: Prot-e-schee]
Tel: 0660 / 415 65 31

****** Radiointerview zum Thema Spam ******
http://www.it-podcast.at/archiv.html#podcast-100716

// Wir haben im Moment zwei Häuser zu verkaufen:
// http://zmi.at/langegg/
// http://zmi.at/haus2009/

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 12:09 cannot defrag volume, fragmentation factor 21.73% Richard Ems
  2010-10-18 12:39 ` Michael Monnerie
@ 2010-10-18 20:16 ` Stan Hoeppner
  2010-10-18 23:10 ` Dave Chinner
  2 siblings, 0 replies; 9+ messages in thread
From: Stan Hoeppner @ 2010-10-18 20:16 UTC (permalink / raw)
  To: xfs

Richard Ems put forth on 10/18/2010 7:09 AM:

> I ran several times xfs_fsr, but the 21.73% factor stays there.
> There where some busy or modified files on which I started xfs_fsr later
> again, but this ones where small files and the 21.73% is still there.
> 
> Any ideas?

Yes.  The answer is in a thread in last month's archive:
http://oss.sgi.com/pipermail/xfs/2010-September/047003.html

Dave Chinner put forth on 9/11/2010 3:23 AM:

> xfs_db used buffered IO on the block device, which is not coherent
> with the filesystem. If you are using it on an active filesystem,
> then running "echo 1 > /proc/sys/vm/drop_caches" before you run
> xfs_db should make it read from disk at least once....


-- 
Stan

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 12:09 cannot defrag volume, fragmentation factor 21.73% Richard Ems
  2010-10-18 12:39 ` Michael Monnerie
  2010-10-18 20:16 ` Stan Hoeppner
@ 2010-10-18 23:10 ` Dave Chinner
  2010-10-19  9:37   ` Richard Ems
  2010-10-22 10:12   ` Richard Ems
  2 siblings, 2 replies; 9+ messages in thread
From: Dave Chinner @ 2010-10-18 23:10 UTC (permalink / raw)
  To: Richard Ems; +Cc: xfs

On Mon, Oct 18, 2010 at 02:09:52PM +0200, Richard Ems wrote:
> Hi all,
> 
> this is on openSUSE 11.3.
> 
> # uname -a
> Linux fs1 2.6.34.7-0.3-default #1 SMP 2010-09-20 15:27:38 +0200
> x86_64 x86_64 x86_64 GNU/Linux
> 
> # echo frag | xfs_db -r /dev/disk/by-label/data1
> xfs_db> actual 6451844, ideal 5050129, fragmentation factor 21.73%
> 
> # xfs_db -V
> xfs_db version 3.1.2
> 
> # xfs_fsr -V
> xfs_fsr version 3.1.2
> 
> # df -h /dev/sdb1
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/sdb1              17T   13T  4.3T  75% /data_1
> 
> The volume is new, 12TB were rsync'ed from another volume, some new
> files came after the sync.
> 
> I ran several times xfs_fsr, but the 21.73% factor stays there.
> There where some busy or modified files on which I started xfs_fsr
> later again, but this ones where small files and the 21.73% is still
> there.

Understand your numbers. What frag reports is how many extents there
are vs a perfect layout. It does not tell you how badly fragmented
your filesystem is. Extent-based filesystems can have
"fragmentation" like you see reported above, but not suffer at all
because the extents are large enough not to affect IO throughput.

e.g. If I have a 100GB file in 100x1GB extents, frag would report an
ideal of 17 extents and measure 100. That would give a frag factor
of 83%. Now, is that filesystem fragmented? Theoretically yes.
Practically, no.

Why? Because extents of 1GB are more than large enough for any IO to
that file reach full throughput. Therefore, while the file layout is
not perfect, the "fragmentation" has no impact on performance and
therefore the filesystem should not be considered fragmented.

So, for 13TB of data, having 20% of your files with two extents
rather than one is not a problem unless that causes you application
measurable performance issues...

IOWs, trying to reduce fragmentation without understanding what the
numbers tell you about the layout of your filesystem can be counter
productive. Especially as running xfs_fsr when you don't really need
to can have other side-effects that affect the long-term aging
characteristics of the filesystem (e.g. causing preamture free space
fragmentation).

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 23:10 ` Dave Chinner
@ 2010-10-19  9:37   ` Richard Ems
  2010-10-22 10:12   ` Richard Ems
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Ems @ 2010-10-19  9:37 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On 10/19/2010 01:10 AM, Dave Chinner wrote:
> On Mon, Oct 18, 2010 at 02:09:52PM +0200, Richard Ems wrote:
>> Hi all,
>>
>> this is on openSUSE 11.3.
>>
>> # uname -a
>> Linux fs1 2.6.34.7-0.3-default #1 SMP 2010-09-20 15:27:38 +0200
>> x86_64 x86_64 x86_64 GNU/Linux
>>
>> # echo frag | xfs_db -r /dev/disk/by-label/data1
>> xfs_db>  actual 6451844, ideal 5050129, fragmentation factor 21.73%
>>
>> # xfs_db -V
>> xfs_db version 3.1.2
>>
>> # xfs_fsr -V
>> xfs_fsr version 3.1.2
>>
>> # df -h /dev/sdb1
>> Filesystem            Size  Used Avail Use% Mounted on
>> /dev/sdb1              17T   13T  4.3T  75% /data_1
>>
>> The volume is new, 12TB were rsync'ed from another volume, some new
>> files came after the sync.
>>
>> I ran several times xfs_fsr, but the 21.73% factor stays there.
>> There where some busy or modified files on which I started xfs_fsr
>> later again, but this ones where small files and the 21.73% is still
>> there.
>
> Understand your numbers. What frag reports is how many extents there
> are vs a perfect layout. It does not tell you how badly fragmented
> your filesystem is. Extent-based filesystems can have
> "fragmentation" like you see reported above, but not suffer at all
> because the extents are large enough not to affect IO throughput.
>
> e.g. If I have a 100GB file in 100x1GB extents, frag would report an
> ideal of 17 extents and measure 100. That would give a frag factor
> of 83%. Now, is that filesystem fragmented? Theoretically yes.
> Practically, no.
>
> Why? Because extents of 1GB are more than large enough for any IO to
> that file reach full throughput. Therefore, while the file layout is
> not perfect, the "fragmentation" has no impact on performance and
> therefore the filesystem should not be considered fragmented.
>
> So, for 13TB of data, having 20% of your files with two extents
> rather than one is not a problem unless that causes you application
> measurable performance issues...
>
> IOWs, trying to reduce fragmentation without understanding what the
> numbers tell you about the layout of your filesystem can be counter
> productive. Especially as running xfs_fsr when you don't really need
> to can have other side-effects that affect the long-term aging
> characteristics of the filesystem (e.g. causing preamture free space
> fragmentation).
>
> Cheers,
>
> Dave.

Hi Dave,

many thanks for the clarification. I will go again through the XFS 
documentation and try to "understand my numbers" as you wrote.

Thanks again,
Richard


-- 
Richard Ems       mail: Richard.Ems@Cape-Horn-Eng.com

Cape Horn Engineering S.L.
C/ Dr. J.J. Dómine 1, 5º piso
46011 Valencia
Tel : +34 96 3242923 / Fax 924
http://www.cape-horn-eng.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-18 23:10 ` Dave Chinner
  2010-10-19  9:37   ` Richard Ems
@ 2010-10-22 10:12   ` Richard Ems
  2010-10-22 21:02     ` Michael Monnerie
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Ems @ 2010-10-22 10:12 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On 10/19/2010 01:10 AM, Dave Chinner wrote:
> Understand your numbers. What frag reports is how many extents there
> are vs a perfect layout. It does not tell you how badly fragmented
> your filesystem is. Extent-based filesystems can have
> "fragmentation" like you see reported above, but not suffer at all
> because the extents are large enough not to affect IO throughput.

Hi Dave,

I think I almost got that now.
But, at which numbers should I look at before starting a defrag then?

Up to now, I ran always "echo frag | xfs_db -r /dev/..." to get a 
"number" that could tell me if starting a xfs_fsr was necessary.

At which other numbers should I look at to see if running a xfs_fsr 
defrag is necessary or not?

Many thanks,
Richard


-- 
Richard Ems       mail: Richard.Ems@Cape-Horn-Eng.com

Cape Horn Engineering S.L.
C/ Dr. J.J. Dómine 1, 5º piso
46011 Valencia
Tel : +34 96 3242923 / Fax 924
http://www.cape-horn-eng.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: cannot defrag volume, fragmentation factor 21.73%
  2010-10-22 10:12   ` Richard Ems
@ 2010-10-22 21:02     ` Michael Monnerie
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Monnerie @ 2010-10-22 21:02 UTC (permalink / raw)
  To: xfs; +Cc: Richard Ems


[-- Attachment #1.1: Type: Text/Plain, Size: 1347 bytes --]

On Freitag, 22. Oktober 2010 Richard Ems wrote:
> But, at which numbers should I look at before starting a defrag then?

Watch the performance of your application. Record answer times with 
munin or something, and if you ever "feel" it's too slow, look at the 
recorded numbers again to see if your feelings fit the measurements. 
Don't be paranoid about fragmentation. The more people access a server 
at a time, the less important fragmentation is. 

If you got 100 people streaming 100 perfect defragmented files, you 
still got an access pattern that needs to move the disk head to 100 
different positions all the time. If your single disk can't do that many 
I/O's, build up a RAID, or get faster disks (10kprm, 15krpm, SSD).

Defrag is more for single threaded I/O workloads, where one stream at a 
time has to be read/written. Therefore it helps on a Windows PC more 
than on a server. Only use defrag if you really have lots of chunks per 
file.

-- 
mit freundlichen Grüssen,
Michael Monnerie, Ing. BSc

it-management Internet Services
http://proteger.at [gesprochen: Prot-e-schee]
Tel: 0660 / 415 65 31

****** Radiointerview zum Thema Spam ******
http://www.it-podcast.at/archiv.html#podcast-100716

// Wir haben im Moment zwei Häuser zu verkaufen:
// http://zmi.at/langegg/
// http://zmi.at/haus2009/

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-10-22 21:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-18 12:09 cannot defrag volume, fragmentation factor 21.73% Richard Ems
2010-10-18 12:39 ` Michael Monnerie
2010-10-18 13:46   ` Richard Ems
2010-10-18 17:58     ` Michael Monnerie
2010-10-18 20:16 ` Stan Hoeppner
2010-10-18 23:10 ` Dave Chinner
2010-10-19  9:37   ` Richard Ems
2010-10-22 10:12   ` Richard Ems
2010-10-22 21:02     ` Michael Monnerie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox