From owner-freebsd-current@freebsd.org Thu Nov 26 17:46:07 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D796746A3FB for ; Thu, 26 Nov 2020 17:46:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChlYC5cqxz4pFg for ; Thu, 26 Nov 2020 17:46:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id f27so1608806qtv.6 for ; Thu, 26 Nov 2020 09:46:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q71My08xmhDAKML5Ct6IV7iC4isJFx3OWCkSekPR9ww=; b=X1e1nUh6V3Awu21NJaZUbYSstRXBry7n1vrmJ6Y0fqXCXkg2TGwHt4InYZ7YgpLASQ Rh/wTf27xEhakGLHNmesApjYkw+38/ZVvX5jxzU2Xi/IYVz3EjRSuuZ162m/9hJ3W+B+ f578MurFS1bBv0sWbP1g4+vY/WxEePnAeTkrN2WJsUoIFzNPacbuUEfdSc2tEgxxKl1l l078+t3CAwmMHxYL1RT2+kYF1Rmzk0juAooDGqfhmHd8Juy2uT35RLeIFgwncwr4t4uO 1O8yKCE4LZNdxPO2tAGIQLMKBKBzO1Wnkdvt1QCyIbvF222rOYSzVuW9CqGShmFUiHWg +LjQ== X-Gm-Message-State: AOAM532Q030LoC/+VNg2N2VeTMv7teDu5dVaQwCHlbukgDfK2F/0Y1uO BUjBgWCD9CIcsMX7bPHyy5quMB6KBhyK6nD4ov5kqw== X-Google-Smtp-Source: ABdhPJxuer7XybofsNHKzuF0WHKGvh95qM3imtLXRePI+y/VDronFDs4ATqBQHvyi2MsWIyZy+ZnwBv4C13MkZILzVY= X-Received: by 2002:ac8:7619:: with SMTP id t25mr4171293qtq.244.1606412766996; Thu, 26 Nov 2020 09:46:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Thu, 26 Nov 2020 10:45:55 -0700 Message-ID: Subject: Re: possible usb3-connected hard drive spin down causing lag To: Dimitry Andric Cc: tech-lists , FreeBSD Current X-Rspamd-Queue-Id: 4ChlYC5cqxz4pFg X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:46:07 -0000 On Thu, Nov 26, 2020 at 2:47 AM Dimitry Andric wrote: > On 26 Nov 2020, at 01:10, tech-lists wrote: > > > > I have a usb3-connected harddrive. dmesg shows this: > > [...] > > da0: 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 > Should we have this, or a similar 'standby' setting as well in base? this question comes up a lot... Warner