🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #188

[Bug 299733] freebsd-update is slow on spinning hdd

#188
From: bugzilla-noreply
Date: Thu, 22 Oct 2026 13:47
56 lines
3937 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299733

            Bug ID: 299733
           Summary: freebsd-update is slow on spinning hdd
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: titus@edc.ro

Created attachment 276107
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=276107&action=edit
fixes slowness of freebsd-update (mostly install)

freebsd-update is extremely slow on hdds in various phases but the install
phase only pushes 2-3 files per second and for thousands of files its very bad

the simple fix is to have a tmpfs scratch dir used to decompress the file
before installing it on the fs and then remove it instead on doing it in
/var/db/freebsd-update directly (/var/db/freebsd-update can't be on non
persistent storage)
from 14.5 on we can zcat ${HASH}.gz |install - 
but only 14.5 has an install capable of installing /dev/stdin

mostly the patch does this 
-                               gunzip < files/${HASH}.gz > ${HASH}
+                               gunzip < files/${HASH}.gz >
${SCRATCHDIR}${HASH}
                                install -o ${OWNER} -g ${GROUP}         \
-                                   -m ${PERM} ${HASH} ${BASEDIR}/${FPATH}
-                               rm ${HASH}
+                                   -m ${PERM} ${SCRATCHDIR}${HASH}
${BASEDIR}/${FPATH}
+                               rm ${SCRATCHDIR}${HASH}

if $SCRATCHDIR is for example /tmp/ which is tmpfs the speedup is 150x for 1000
files (2.7 sec vs 5min)

the attached patch has other improvements but they are not as significant

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-299733-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 299733] freebsd-update is slow on spinning hdd
Date: Thu, 22 Oct 2026 13:47:41 +0000
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-bugs@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-299733-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="21474"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1792676864;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=gueUz3ldLwJwkDK1oZXTxZEgV7lbcH5ItZvpBNhqV6o=;
	b=u7e32izeuYfrqI5Wj1KOlSAhfBBPjfyxen6MSzGgDF1IZEmOsOyzpnJSOIwXNS07mZuxU3
	lwTxwmoFMOboggZu4NS2E6Grz+Wnf++ve6coW7qDQbVr4nBzM2gFSuVIapLRYCBrR95Pei
	4rYLsp1VUejmsQjAXzI7LMCk0IFn9N6eEg+uGkpf6tTinKj8Ak/XhKO2d20oz/m00HPvhl
	a6DUhe3tmSd+fjLHoTWbaNDpByBu9QO5qsrr9ZEx+WILV6zrIyLte8KQvQ7/BdPzBF2zZo
	D0DcGYZl/FW86mEZBw53bihqJRkyv298D7MVJ4ozMpdyTf1EOuxXvP0urMZVQQ==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes