Filesystem operations slower in 13.0 than 12.2
Mark Millard
marklmi at yahoo.com
Thu Mar 4 22:16:35 UTC 2021
Christos Chatzaras chris at cretaforce.gr wrote on
Thu Mar 4 21:41:01 UTC 2021 :
> After finding slow filesystem operations with 13.0-BETA2 I did more tests.
>
> All tests done with same hardware (Seagate ST4000NM0245 4TB HDD - 2 disks with RAID-1 using gmirror).
>
> Filesystem mounted with noatime.
>
> Command used:
>
> /usr/bin/time -l portsnap extract
>
> but similar differences I see with "/usr/bin/time -l rm -fr /usr/ports"
I doubt that "rm -fr" gets large differences of the
type:
(from 12.2p4:)
0 messages sent
0 messages received
vs. (13.0-BETA4 and 14.0-CURRENT:)
4412 messages sent
2536379 messages received
In other words, large variations in Inter-Process-Communiciation
counts, especially "received".
It is not obvious that the "portsnap extract" issue
is dominated by file system I/O vs IPC issues.
portsanp is a script and does something that looks
like the following, with the "while read" happening
over 29000 times:
. . . | while read FILE HASH; do
echo ${PORTSDIR}/${FILE}
if ! [ -s "${WORKDIR}/files/${HASH}.gz" ]; then
echo "files/${HASH}.gz not found -- snapshot corrupt."
return 1
fi
case ${FILE} in
*/)
rm -rf ${PORTSDIR}/${FILE%/}
mkdir -p ${PORTSDIR}/${FILE}
tar -xz --numeric-owner -f ${WORKDIR}/files/${HASH}.gz \
-C ${PORTSDIR}/${FILE}
;;
*)
rm -f ${PORTSDIR}/${FILE}
tar -xz --numeric-owner -f ${WORKDIR}/files/${HASH}.gz \
-C ${PORTSDIR} ${FILE}
;;
esac
done; then
I expect that the "tar -xz . . . *.gz" sort of commands
also involve internal IPC use. (It looked like the
portsnap script has not changed noticeably since
something like late 2016.)
(13.0-BETA2 showed a large "voluntary context switches"
difference as well, but I ignore that middle step in
the version sequence here.)
So I expect publishing the "rm -fr /usr/ports" figures
from "time -l" would be appropriate. I do not know if
the reports should be via separate topic or not but I
doubt the figures with large differences will be the
same for most-modern vs. older: I do not expect notable
IPC from "rm -fr".
> ----------
>
> FreeBSD 12.2p4
>
> 98.18 real 35.31 user 59.31 sys
> 49064 maximum resident set size
> 21 average shared memory size
> 3 average unshared data size
> 86 average unshared stack size
> 11821398 page reclaims
> 0 page faults
> 0 swaps
> 29 block input operations
> 2783 block output operations
> 0 messages sent
> 0 messages received
> 0 signals received
> 354648 voluntary context switches
> 322 involuntary context switches
>
> ----------
>
> FreeBSD 13.0-BETA2 (2021-02-12)
>
> 497.88 real 76.06 user 120.03 sys
> 49032 maximum resident set size
> 22 average shared memory size
> 3 average unshared data size
> 91 average unshared stack size
> 12288156 page reclaims
> 23 page faults
> 0 swaps
> 29890 block input operations
> 621229 block output operations
> 4412 messages sent
> 2536379 messages received
> 0 signals received
> 1004790 voluntary context switches
> 251 involuntary context switches
>
> --------------
>
> FreeBSD 13.0-BETA4 (2021-02-26)
>
> 163.81 real 71.93 user 107.32 sys
> 49032 maximum resident set size
> 21 average shared memory size
> 3 average unshared data size
> 89 average unshared stack size
> 12288156 page reclaims
> 5 page faults
> 0 swaps
> 716 block input operations
> 868 block output operations
> 4412 messages sent
> 2536379 messages received
> 0 signals received
> 355244 voluntary context switches
> 277 involuntary context switches
>
> ----------
>
> FreeBSD 14-CURRENT (2021-03-04)
>
> 255.43 real 74.94 user 148.90 sys
> 49032 maximum resident set size
> 23 average shared memory size
> 3 average unshared data size
> 96 average unshared stack size
> 12288156 page reclaims
> 23 page faults
> 0 swaps
> 31207 block input operations
> 175 block output operations
> 4412 messages sent
> 2536379 messages received
> 0 signals received
> 385527 voluntary context switches
> 369 involuntary context switches
>
> ----------
>
> Differences between 13.0 and 14-CURRENT maybe related to debugging features.
>
> But 13.0-BETA4 is slower than 12.2. Does someone have more information about this?
Again, I expect that the "time -l" figures may point in
different directions for "portsnap extract" vs.
"rm -fr /usr/ports" in your context. The question may
need to be split because the answers may be different.
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
More information about the freebsd-stable
mailing list