Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Larkin Lowrey <llowrey@nuclearwinter.com>
To: Adam Talbot <ajtalbot1@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: Sleepy drives and MD RAID 6
Date: Mon, 11 Aug 2014 20:21:37 -0500	[thread overview]
Message-ID: <53E96C21.2050309@nuclearwinter.com> (raw)
In-Reply-To: <CAH_2GheOOaJRp7YimEsorFzGUJyObG2QsOpu87CYvwLPwz-V+A@mail.gmail.com>

I was in the same boat and decided to solve the problem with some code.

I wrote a daemon that monitors /sys/block/sd?/stat for each member of
the array. If all the drives have been idle for X seconds the daemon
sends a spindown command to each member in parallel. If the array is
spun down the daemon watches for any change in the aforementioned stat
file and if there is it spins up all members in parallel.

The affect of this is the array spin-up time is only as long as the
slowest drive and all the drives spin down at the same time. My
experience has been that leaving spindown up to the drives is a bad
idea. Different models and different manufacturers have varying notions
of what 10 minutes means. Also, leaving spin-up to the controller is
also not so hot since some controllers spin-up the drives sequentially
rather than in parallel.

I'd be happy to share the code and even happier if someone wrote
something better!

--Larkin

On 8/11/2014 8:03 PM, Adam Talbot wrote:
> I need help from the Linux RAID pros.
>
> To make a very long story short; I have a 7 disk in a RAID 6 array.  I
> put the drives to sleep after 7 minutes of inactivity.  When I go to
> use this array the spin up time is causing applications to hang.
> Current spin up time is 50 seconds, but will be getting worse as I add
> drives.
>
> Here is the MUCH longer description including more specs (DingbatCA):
> http://forums.gentoo.org/viewtopic-p-7599010.html
>
> Any help would be greatly appreciated.  I think this would make a
> great wiki article.
>
> More details bellow:
> root@nas:/data# smartctl -a /dev/sdd | grep Spin_Up
>   3 Spin_Up_Time            0x0027   150   137   021    Pre-fail
> Always       -       9608
>
> root@nas:/data# time (touch foo ; sync)
> real    0m49.004s
> user    0m0.000s
> sys     0m0.004s
>
> root@nas:/data# time (touch foo ; sync)
> real    0m50.647s
> user    0m0.000s
> sys     0m0.008s
>
> root@nas:/data# df -h /data
> Filesystem      Size  Used Avail Use% Mounted on
> /dev/md125      9.1T  3.8T  5.4T  42% /data
>
> root@nas:/data# mdadm -D /dev/md125
> /dev/md125:
>         Version : 1.2
>   Creation Time : Wed Jun 18 07:54:38 2014
>      Raid Level : raid6
>      Array Size : 9766909440 (9314.45 GiB 10001.32 GB)
>   Used Dev Size : 1953381888 (1862.89 GiB 2000.26 GB)
>    Raid Devices : 7
>   Total Devices : 7
>     Persistence : Superblock is persistent
>
>     Update Time : Mon Aug 11 16:30:16 2014
>           State : clean
>  Active Devices : 7
> Working Devices : 7
>  Failed Devices : 0
>   Spare Devices : 0
>
>          Layout : left-symmetric
>      Chunk Size : 512K
>
>            Name : nas:data  (local to host nas)
>            UUID : 74f9ce7a:df1c2698:c8ec7259:5fdb2618
>          Events : 1038642
>
>     Number   Major   Minor   RaidDevice State
>        0       8       17        0      active sync   /dev/sdb1
>        1       8       33        1      active sync   /dev/sdc1
>        3       8       49        2      active sync   /dev/sdd1
>        4       8       65        3      active sync   /dev/sde1
>        5       8       81        4      active sync   /dev/sdf1
>        7       8      145        5      active sync   /dev/sdj1
>        6       8      129        6      active sync   /dev/sdi1
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2014-08-12  1:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12  1:03 Sleepy drives and MD RAID 6 Adam Talbot
2014-08-12  1:21 ` Larkin Lowrey [this message]
2014-08-12  1:31   ` Adam Talbot
2014-08-12  5:55   ` Can Jeuleers
2014-08-12  9:46     ` Wilson, Jonathan
2014-08-12 15:26       ` Adam Talbot
     [not found]       ` <CAH_2GhfBKiJAT=+zCFH0_xkmyTfWFi=c-F+z8rwL1x++UwU+KA@mail.gmail.com>
2014-08-13 16:07         ` Adam Talbot
2014-08-14 16:50           ` Adam Talbot
2014-08-14 17:00             ` Larkin Lowrey
2014-08-14 17:37               ` Adam Talbot
2014-08-14 18:05                 ` Larkin Lowrey
2014-08-18 15:41                   ` Adam Talbot
2014-08-18 16:16                     ` Larkin Lowrey
     [not found]                       ` <CAH_2GhcwHszr75bbDq2aWRnnF8-ttpGERKE=CKt=Nri3ue9row@mail.gmail.com>
2014-08-28 21:04                         ` Adam Talbot
2014-08-12  3:29 ` Roman Mamedov
2014-08-14 18:10   ` Bill Davidsen
2014-08-14 19:33     ` Adam Talbot

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=53E96C21.2050309@nuclearwinter.com \
    --to=llowrey@nuclearwinter.com \
    --cc=ajtalbot1@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox