Am 03.01.25 um 00:36 schrieb Ángel:
On 2025-01-02 at 17:11 +0300, Michael Tokarev wrote:
02.01.2025 03:00, Aurélien COUDERC wrote:

Sure but I wouldn’t know how to do that since I’m calling apt and
force-unsafe-io seems to be a dpkg option ?

echo force-unsafe-io > /etc/dpkg/dpkg.conf.d/unsafeio

before upgrade.

/mjt

Beware: this should actually be

  echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/unsafeio

:)

Out of curiosity I've made a benchmark of my own. In my experience you hardly notice slowdown on desktop machines with modern NVMe drives, but you notice it on bad storage. I.e. I just happen to have a small (3 old nodes, 9 osd with cheap SSD) old CEPH cluster at hand and a bookworm VM with 42 pending updates on it. Small 2 vCPU/2GB RAM VM. Snapshotted after downloading all packages locally.

Shared infrastructure of course. Note that this includes an update of the initramfs, which is CPU bound and takes a bit on this system. You can take around 45s off the clock for the initramfs regeneration in each run. I did a couple of runs and the results were pretty consistent.

/dev/mapper/proxy1-root on / type ext4 (rw,relatime,errors=remount-ro)

time apt -y dist-upgrade; time sync

The following packages will be upgraded:
base-files bsdextrautils bsdutils distro-info-data initramfs-tools initramfs-tools-core iputils-ping libblkid1 libc-bin libc-l10n libc6 libcurl3-gnutls libfdisk1 libglib2.0-0 libglib2.0-data libmount1 libnghttp2-14 libnss-systemd libpam-systemd libpython3.11 libpython3.11-minimal libpython3.11-stdlib libsmartcols1 libsqlite3-0 libssl3 libsystemd-shared libsystemd0 libudev1 libuuid1 locales locales-all mount nscd openssl python3.11 python3.11-minimal systemd systemd-sysv udev util-linux util-linux-extra util-linux-locales

Default settings:

real    1m50.451s
user    0m52.333s
sys     0m33.574s

real    0m0.236s
user    0m0.007s
sys     0m0.001s


force-unsafe-io

real    1m47.309s
user    0m52.072s
sys     0m32.334s

real    0m0.324s
user    0m0.005s
sys     0m0.001s


eatmydata

real    1m36.407s
user    0m51.810s
sys     0m34.764s

real    0m0.334s
user    0m0.001s
sys     0m0.010s

So removing the time needed for the initramfs we have around 65s unchanged vs. 62s with force-unsafe-io vs. 51s with eatmydata. Or, < 5% speedup with force-unsafe-io on this system.

I have the snapshot still at hand, if there are other options you'd like to test drop me a note.

Bernhard

Reply via email to