possible usb3-connected hard drive spin down causing lag

Dimitry Andric dim at FreeBSD.org
Thu Nov 26 09:46:48 UTC 2020


On 26 Nov 2020, at 01:10, tech-lists <tech-lists at zyxst.net> wrote:
> 
> 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 have been using the attached rc.d script for a long time now, which
uses camcontrol(8)'s "apm" and "aam" commands to set drives to 'maximum
performance' (aka don't try to save power by shutting down all the
time).

Just drop this into /usr/local/etc/rc.d, and add something like the
following to your rc.conf:

camperf_devices="da0 da1"
camperf_enable="YES"

You can also manually start the rc.d script by running:

sudo service camperf start

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: camperf
Type: application/octet-stream
Size: 756 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20201126/c68164e7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20201126/c68164e7/attachment.sig>


More information about the freebsd-current mailing list