Dave,<div><br></div><div>Thanks so much for that informative read. This helps me fight my case that systematic</div><div>defrags are not needed and are bad for the system in general.</div><div><br></div><div>After reading this I did do some checks against some of our larger tables and found that</div>
<div>on average we are storing about 2.5GB per extent. For me that seems pretty reasonable</div><div>to me and does not require defrag'ing at this time.</div><div><br></div><div>--David Fuller</div><div><br><br><a href="http://www.topshelfads.com/email/sig/epochbestbilling.jpg" target="_blank"></a><br>
<br><br><div class="gmail_quote">On Wed, Apr 11, 2012 at 7:16 PM, Dave Chinner <span dir="ltr"><<a href="mailto:david@fromorbit.com">david@fromorbit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Apr 11, 2012 at 06:04:25PM -0700, David Fuller wrote:<br>
> We seen to be having an issue whereby our database server<br>
> gets to 90% or higher fragmentation. When it gets to this point<br>
> we would need to remove form production and defrag using the<br>
> xfs_fsr tool.<br>
<br>
</div>Bad assumption.<br>
<div class="im"><br>
> The server does get a lot of writes and reads. Is<br>
> there something we can do to reduce the fragmentation or could<br>
> this be a result of hard disk tweaks we use or mount options?<br>
><br>
> here is some fo the tweaks we do:<br>
><br>
> /bin/echo "512" > /sys/block/sda/queue/read_ahead_kb<br>
> /bin/echo "10000" > /sys/block/sda/queue/nr_requests<br>
> /bin/echo "512" > /sys/block/sdb/queue/read_ahead_kb<br>
> /bin/echo "10000" > /sys/block/sdb/queue/nr_requests<br>
> /bin/echo "noop" > /sys/block/sda/queue/scheduler<br>
> /bin/echo "noop" > /sys/block/sdb/queue/scheduler<br>
<br>
</div>They have no effect on filesystem fragmentation.<br>
<div class="im"><br>
> Adn here are the mount options on one of our servers:<br>
><br>
> xfs rw,noikeep,allocsize=256M,logbufs=8,sunit=128,swidth=2304<br>
><br>
> the sunit and swidth vary on each server based on disk drives.<br>
><br>
> We do use LVM on the volume where the mysql data is stored<br>
> as we need this for snapshotting. Here is an example of a current state:<br>
><br>
> xfs_db -c frag -r /dev/mapper/vgmysql-lvmysql<br>
> actual 42586, ideal 3134, fragmentation factor 92.64%<br>
<br>
</div>Read this first:<br>
<br>
<a href="http://xfs.org/index.php/XFS_FAQ#Q:_The_xfs_db_.22frag.22_command_says_I.27m_over_50.25.__Is_that_bad.3F" target="_blank">http://xfs.org/index.php/XFS_FAQ#Q:_The_xfs_db_.22frag.22_command_says_I.27m_over_50.25.__Is_that_bad.3F</a><br>
<br>
Then decide whether 10 extents per file is really a problem or not.<br>
<br>
Cheers,<br>
<br>
Dave.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Dave Chinner<br>
<a href="mailto:david@fromorbit.com">david@fromorbit.com</a><br>
</font></span></blockquote></div><br></div>