All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stan Hoeppner <stan@hardwarefreak.com>
To: Jessie Evangelista <jessie.evangelista@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: raid10n2/xfs setup guidance on write-cache/barrier
Date: Thu, 15 Mar 2012 00:38:02 -0500	[thread overview]
Message-ID: <4F61803A.60009@hardwarefreak.com> (raw)
In-Reply-To: <CAA8mOyDKrWg0QUEHxcD4ocXXD42nJu0TG+sXjC4j2RsigHTcmw@mail.gmail.com>

On 3/14/2012 7:30 PM, Jessie Evangelista wrote:
> I want to create a raid10,n2 using 3 1TB SATA drives.
> I want to create an xfs filesystem on top of it.
> The filesystem will be used as NFS/Samba storage.
> 
> mdadm --zero /dev/sdb1 /dev/sdc1 /dev/sdd1
> mdadm -v --create /dev/md0 --metadata=1.2 --assume-clean
> --level=raid10 --chunk 256 --raid-devices=3 /dev/sdb1 /dev/sdc1
> /dev/sdd1

Why 256KB for chunk size?


Looks like you've been reading a very outdated/inaccurate "XFS guide" on
the web...

What kernel version?  This can make a significant difference in XFS
metadata performance.  You should use 2.6.39+ if possible.  What
xfsprogs version?

> mkfs -t xfs -l lazy-count=1,size=128m -f /dev/md0

lazy-count=1 is currently the default with recent xfsprogs so no need to
specify it.  Why are you manually specifying the size of the internal
journal log file?  This is unnecessary.  In fact, unless you have
profiled your workload and testing shows that alternate XFS settings
perform better, it is always best to stick with the defaults.  They
exist for a reason, and are well considered.

> mount -t xfs -o barrier=1,logbsize=256k,logbufs=8,noatime /dev/md0
> /mnt/raid10xfs

Barrier has no value, it's either on or off.  XFS mounts with barriers
enabled by default so remove 'barrier=1'.  You do not have a RAID card
with persistent write cache (BBWC), so you should leave barriers
enabled.  Barriers mitigate journal log corruption due to power failure
and crashes, which seem seem to be of concern to you.

logbsize=256k and logbufs=8 are the defaults in recent kernels so no
need to specify them.  Your NFS/Samba workload on 3 slow disks isn't
sufficient to need that much in memory journal buffer space anyway.  XFS
uses relatime which is equivalent to noatime WRT IO reduction
performance, so don't specify 'noatime'.

In fact, it appears you don't need to specify anything in mkfs.xfs or
fstab, but just use the defaults.  Fancy that.  And the one thing that
might actually increase your performance a little bit you didn't
specify--sunit/swidth.  However, since you're using mdraid, mkfs.xfs
will calculate these for you (which is nice as mdraid10 with odd disk
count can be a tricky calculation).  Again, defaults work for a reason.

> Will my files be safe even on sudden power loss?

Are you unwilling to purchase a UPS and implement shutdown scripts?  If
so you have no business running a server, frankly.  Any system will lose
data due to power loss, it's just a matter of how much based on the
quantity of inflight writes at the time the juice dies.  This problem is
mostly filesytem independent.  Application write behavior does play a
role.  UPS with shutdown scripts, and persistent write cache prevent
this problem.  A cheap UPS suitable for this purpose is less money than
a 1TB 7.2k drive, currently.

You say this is an NFS/Samba server.  That would imply that multiple
people or other systems directly rely on it.  Implement a good UPS
solution and eliminate this potential problem.

> Is barrier=1 enough?
> Do i need to disable the write cache?
> with: hdparm -W0 /dev/sdb /dev/sdc /dev/sdd

Disabling drive write caches does decrease the likelihood of data loss.

> I tried it but performance is horrendous.

And this is why you should leave them enabled and use barriers.  Better
yet, use a RAID card with BBWC and disable the drive caches.

> Am I better of with ext4? Data safety/integrity is the priority and
> optimization affecting it is not acceptable.

You're better off using a UPS.  Filesystem makes little difference WRT
data safety/integrity.  All will suffer some damage if you throw a
grenade at them.  So don't throw grenades.  Speaking of which, what is
your backup/restore procedure/hardware for this array?

> Thanks and any advice/guidance would be appreciated

I'll appreciate your response stating "Yes, I have a UPS and
tested/working shutdown scripts" or "I'll be implementing a UPS very
soon." :)

-- 
Stan


  reply	other threads:[~2012-03-15  5:38 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15  0:30 raid10n2/xfs setup guidance on write-cache/barrier Jessie Evangelista
2012-03-15  5:38 ` Stan Hoeppner [this message]
2012-03-15 12:06   ` Jessie Evangelista
2012-03-15 14:07     ` Peter Grandi
2012-03-15 14:07       ` Peter Grandi
2012-03-15 15:25       ` keld
2012-03-15 15:25         ` keld
2012-03-15 16:52         ` Jessie Evangelista
2012-03-15 16:52           ` Jessie Evangelista
2012-03-15 17:15           ` keld
2012-03-15 17:15             ` keld
2012-03-15 17:40             ` keld
2012-03-15 17:40               ` keld
2012-03-15 16:18       ` Jessie Evangelista
2012-03-15 16:18         ` Jessie Evangelista
2012-03-15 23:00         ` Peter Grandi
2012-03-15 23:00           ` Peter Grandi
2012-03-16  3:36           ` Jessie Evangelista
2012-03-16  3:36             ` Jessie Evangelista
2012-03-16 11:06             ` Michael Monnerie
2012-03-16 11:06               ` Michael Monnerie
2012-03-16 12:21               ` Peter Grandi
2012-03-16 12:21                 ` Peter Grandi
2012-03-16 17:15             ` Brian Candler
2012-03-16 17:15               ` Brian Candler
2012-03-17 15:35             ` Peter Grandi
2012-03-17 15:35               ` Peter Grandi
2012-03-17 21:39               ` raid10n2/xfs setup guidance on write-cache/barrier (GiB alignment) Zdenek Kaspar
2012-03-17 21:39                 ` Zdenek Kaspar
2012-03-18  0:08                 ` Peter Grandi
2012-03-18  0:08                   ` Peter Grandi
2012-03-26 19:50               ` raid10n2/xfs setup guidance on write-cache/barrier Martin Steigerwald
2012-03-17  4:21       ` NOW:Peter goading Dave over delaylog - WAS: " Stan Hoeppner
2012-03-17 22:34         ` Dave Chinner
2012-03-18  2:09           ` Peter Grandi
2012-03-18  2:09             ` Peter Grandi
2012-03-18 11:25             ` Peter Grandi
2012-03-18 11:25               ` Peter Grandi
2012-03-18 14:00               ` Christoph Hellwig
2012-03-18 14:00                 ` Christoph Hellwig
2012-03-18 19:17                 ` Peter Grandi
2012-03-18 19:17                   ` Peter Grandi
2012-03-19  9:07                   ` Stan Hoeppner
2012-03-19  9:07                     ` Stan Hoeppner
2012-03-20 12:34                     ` Jessie Evangelista
2012-03-20 12:34                       ` Jessie Evangelista
2012-03-18 18:08               ` Stan Hoeppner
2012-03-18 18:08                 ` Stan Hoeppner
2012-03-22 21:26                 ` Peter Grandi
2012-03-22 21:26                   ` Peter Grandi
2012-03-23  5:10                   ` Stan Hoeppner
2012-03-23  5:10                     ` Stan Hoeppner
2012-03-23 22:48                   ` Martin Steigerwald
2012-03-24  1:27                     ` Peter Grandi
2012-03-24 16:27                       ` GNU 'tar', Schilling's 'tar', write-cache/barrier Peter Grandi
2012-03-24 17:11                         ` Brian Candler
2012-03-24 18:35                           ` Peter Grandi
2012-03-16 12:25     ` raid10n2/xfs setup guidance on write-cache/barrier Stan Hoeppner
2012-03-16 18:01       ` Jon Nelson
2012-03-16 18:03         ` Jon Nelson
2012-03-16 19:28           ` Peter Grandi
2012-03-16 19:28             ` Peter Grandi
2012-03-17  0:02             ` Stan Hoeppner
2012-03-17  0:02               ` Stan Hoeppner
2012-03-17 22:10 ` Zdenek Kaspar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F61803A.60009@hardwarefreak.com \
    --to=stan@hardwarefreak.com \
    --cc=jessie.evangelista@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.