From owner-freebsd-current@freebsd.org Thu Nov 26 08:07:33 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 D14ED4A4C75 for ; Thu, 26 Nov 2020 08:07:33 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 4ChVjX2Yg8z3NjG for ; Thu, 26 Nov 2020 08:07:27 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id d142so1225187wmd.4 for ; Thu, 26 Nov 2020 00:07:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=fQfFWpjdcnYPSB8ASjolOjxjZf5tCAEPXLDnvXzBVE8=; b=RPk5qPnd3y2GLtf7l/4W/a2FwWDN/ifhuiOZwO7xvJOFlOcbIfRuFA1oPnl+Vd0ClQ SSBXhi5+cT8parBKR29lb8fuHrCI8YjT44+ERQRjcwgfez8vj3ZAiSzm5pj5oKYvtUKq Ue0LGZwtKjRgVk275ZL35lswodbQWU9TAk+A8C9RigmlCIMfgCDzVPQ/KvPqfZbkZmGR JcfuKnRe3NQRana7pMM66Xi1P6z0aqCMXSJUyq4qdl+paZADi35QFmnLxDc5ETGJmbQX uIjEAo9DICCV1pm7dWDh0XFGffYG+DaKLv4HWcYEsGZgQE7Ounn9X32Kyf/rzbDUe33d AWJw== X-Gm-Message-State: AOAM532/UIwp/Qrqgy9Snm2gfly3kqSPmEysQ/T51wCTjfecPPo8I484 M3WMcdT0QCu9XSAuoajWLaisC/Twv3A= X-Google-Smtp-Source: ABdhPJxNYiJ2MPFt6bqTgN+LJTd85XwB1LH2whxVCYRbeJGcUjQK7jp7285gJeSAuOlVHr/gm0srOA== X-Received: by 2002:a1c:4e06:: with SMTP id g6mr1861242wmh.119.1606378046320; Thu, 26 Nov 2020 00:07:26 -0800 (PST) Received: from ernst.home (p5b02350e.dip0.t-ipconnect.de. [91.2.53.14]) by smtp.gmail.com with ESMTPSA id a184sm6812627wmf.8.2020.11.26.00.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 00:07:25 -0800 (PST) Date: Thu, 26 Nov 2020 09:07:24 +0100 From: Gary Jennejohn To: tech-lists Cc: freebsd-current@freebsd.org Subject: Re: possible usb3-connected hard drive spin down causing lag Message-ID: <20201126080724.1cb3a8af@ernst.home> In-Reply-To: References: Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4ChVjX2Yg8z3NjG X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::344:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[91.2.53.14:received]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::344:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; BLOCKLISTDE_FAIL(0.00)[2a00:1450:4864:20::344:query timed out,91.2.53.14:query timed out]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::344:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] 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 08:07:33 -0000 On Thu, 26 Nov 2020 00:10:40 +0000 tech-lists wrote: > Hi, > > 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'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. -- Gary Jennejohn