[Top] [All Lists]

Re: Fragmentation Issue We Are Having

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: Fragmentation Issue We Are Having
From: David Fuller <dfuller@xxxxxxxxx>
Date: Wed, 11 Apr 2012 19:55:50 -0700
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=epoch.com; h=mime-version :in-reply-to:references:from:date:message-id:subject:to:cc: content-type; s=smtp; bh=xBCPLdgX27zSLhvepueg9f/FNOU=; b=LhkPHiX J3/FOS+32pM/4VIxzny4/Zq8QBi4F3YKDM3HaaBBSWbTVS1zQceZBj/lq5asCleS 09PXhWcRjm7rfSH1zxCFd9S5i56do1YHS4f772CmqpNPRRBbMF2Vxfnce9KrucP6 UnCNid/OSto4T9ccPUxojF+eWq8LmxVxI+84=
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epoch.com; s=gmail; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=V4hNMfs7w/+eOUBMwm9Ej+Ckj/2q806jW5BLc4P3SIM=; b=QSCpQgATRsPEG+97gCTBLHZ3g/tcSlwcbU9/EUXBt+fQqPkpkRj6NN3IA4PeKshv0+ 1tF8JNq+NjT6ErtQMDZ7/70/Wupv3HBxyJIzEfhC7psWPtnDwhN0n0th3Znuara76D5b 2hhTNB3ywGchnpf/8h2fcQTwwtwSU+s5wJvwc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=epoch.com; h=mime-version :in-reply-to:references:from:date:message-id:subject:to:cc: content-type; q=dns; s=smtp; b=d53FNjamhNJmtQXgc25r39J6tOTKkSWpJ Dcy96KN+M/szMB3tbQxayoPdsYXJFcOazUFBMKU7F3HkhBlgAAIs+yl4aoYn6FxS Jd/71XgoQm1wneuyWHFNbD4nBt2AULKdEc3adC7/smqYvHUpcIrCHHbaA9F0F7Bu ZD2qiGXLtY=
In-reply-to: <20120412021626.GX18323@dastard>
References: <CADrkzimg891ZBGK7-UzhGeey16KwH-ZXpEqFr=O3KwD3qA9LwQ@xxxxxxxxxxxxxx> <20120412021626.GX18323@dastard>

Thanks so much for that informative read.  This helps me fight my case that systematic
defrags are not needed and are bad for the system in general.

After reading this I did do some checks against some of our larger tables and found that
on average we are storing about 2.5GB per extent. For me that seems pretty reasonable
to me and does not require defrag'ing at this time.

--David Fuller

On Wed, Apr 11, 2012 at 7:16 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
On Wed, Apr 11, 2012 at 06:04:25PM -0700, David Fuller wrote:
> We seen to be having an issue whereby our database server
> gets to 90% or higher fragmentation.  When it gets to this point
> we would need to remove form production and defrag using the
> xfs_fsr tool.

Bad assumption.

> The server does get a lot of writes and reads.  Is
> there something we can do to reduce the fragmentation or could
> this be a result of hard disk tweaks we use or mount options?
> here is some fo the tweaks we do:
> /bin/echo "512" > /sys/block/sda/queue/read_ahead_kb
> /bin/echo "10000" > /sys/block/sda/queue/nr_requests
> /bin/echo "512" > /sys/block/sdb/queue/read_ahead_kb
> /bin/echo "10000" > /sys/block/sdb/queue/nr_requests
> /bin/echo "noop" > /sys/block/sda/queue/scheduler
> /bin/echo "noop" > /sys/block/sdb/queue/scheduler

They have no effect on filesystem fragmentation.

> Adn here are the mount options on one of our servers:
>  xfs     rw,noikeep,allocsize=256M,logbufs=8,sunit=128,swidth=2304
> the sunit and swidth vary on each server based on disk drives.
> We do use LVM on the volume where the mysql data is stored
> as we need this for snapshotting.  Here is an example of a current state:
> xfs_db -c frag -r /dev/mapper/vgmysql-lvmysql
> actual 42586, ideal 3134, fragmentation factor 92.64%

Read this first:


Then decide whether 10 extents per file is really a problem or not.


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>