Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Nov 2020 01:14:02 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Gary Jennejohn <gljennjohn@gmail.com>
Cc:        tech-lists <tech-lists@zyxst.net>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: possible usb3-connected hard drive spin down causing lag
Message-ID:  <CANCZdfr1wbUY_KxyCca8DDR4b6RVpmp6gN-e3ExKcdHSzJFFbQ@mail.gmail.com>
In-Reply-To: <20201126080724.1cb3a8af@ernst.home>
References:  <X77ygGTS09S91bTC@rpi4.local> <20201126080724.1cb3a8af@ernst.home>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 26, 2020 at 1:07 AM Gary Jennejohn <gljennjohn@gmail.com> wrote:

> On Thu, 26 Nov 2020 00:10:40 +0000
> tech-lists <tech-lists@zyxst.net> wrote:
>
> > Hi,
> >
> > I have a usb3-connected harddrive. dmesg shows this:
> > [...]
> > da0: <ADATA HD710 0> Fixed Direct Access SPC-4 SCSI device
> > [...]
> >
> > running current-r367806-arm64
> >
> > I think it might be auto-spinning-down or auto-sleeping. It's
> > making initial interaction lag of 2-3 seconds.  Is there a sysctl or
> > something somewhere where I can tell it to never sleep?  Or is that
> > something I'd need to contact the manufacturer about?  Or is there
> > an alternative strategy like tmpfs.  It's not a "green" drive but I
> > guess it might be "green" in that it's usb3 powered.
> >
> > I have vfs.read_max=128 in /etc/sysctl.conf
> > zdb has ashift=12
> >
> > In case it's relevant, the filesystem on the disk is zfs. Once
> > "woken up", inferaction is quick, as expected.
> > thanks,
> >
>
> I'd be interested in an answer to this question myself.  I have
> several USB-attached UFS2 disks which spin down after a few minutes.
>
> But, based on some quick searches, this behavior is either a "feature"
> of the disk itself - seems common with so-called green disks - or of
> the controller in the external enclosure or docking station.
>
> This behavior makes sense for drives used with laptops, but for
> desktop computers not so useful.
>
> There are some sysctl's relevant to spindown, but they appear to only
> come into play during suspend or shutdown.  The ones relevant to USB
> which I found are:
>
> kern.cam.ada.spindown_suspend: Spin down upon suspend
> kern.cam.ada.spindown_shutdown: Spin down upon shutdown
>
> There may be commands which a user can send the disk/controller to
> disable this behavior, but I didn't find any with my simple searches.
>

For SAS drives, there's a mode page that controls this behavior.

You might see if the sysutil/ataidle port/package does what you want.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfr1wbUY_KxyCca8DDR4b6RVpmp6gN-e3ExKcdHSzJFFbQ>