johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
50 stars 9 forks source link

Add an option to minimize memory usage #58

Open johnmehr opened 3 years ago

grahamperrin commented 3 years ago

Moved from FreeBSD Forums (please hide as off topic, if it doesn't help) …


2021-04-18

I wondered whether a simple ZFS cache device would help.

As far as I can tell: the effect, if any, is negligible.

First and second runs with the device online, third run offline:

root@mowa219-gjp4-8570p:~ # time gitup ports
load: 1.71 cmd: gitup 11603 [zio->io_cv] 640.53r 3.63u 6.07s 0% 284624k
mi_switch+0xc1 sleepq_timedwait+0x2f _cv_timedwait_sbt+0x107 zio_wait+0x2f9 dmu_buf_hold_array_by_dnode+0x29d dmu_read_uio_dnode+0x3a dmu_read_uio_dbuf+0x3b zfs_read+0x1da zfs_freebsd_read+0x44 VOP_READ_APV+0x1f vn_read+0x1ed vn_io_fault_doio+0x43 vn_io_fault1+0x15c vn_io_fault+0x1a4 dofileread+0x81 sys_read+0xbc amd64_syscall+0x10c fast_syscall_common+0xf8
# Host: git.freebsd.org
# Port: 443
# Repository: /ports.git
# Target: /usr/ports
# Have: ce7525e65911cc709c94f07f6b64477e2e35f7a7
# Want: 72b4c9dd9b214e5c8785494ed92fc39568c15603
# Branch: main
# Action: pull
* /usr/ports/net/quiche/Makefile
* /usr/ports/net/quiche/distinfo
7.803u 11.844s 20:17.92 1.6% 51+171k 144380+77637io 0pf+0w
root@mowa219-gjp4-8570p:~ # time gitup ports
# Host: git.freebsd.org
# Port: 443
# Repository: /ports.git
# Target: /usr/ports
# Have: 72b4c9dd9b214e5c8785494ed92fc39568c15603
# Want: 168a3c4e3a51e4fe8e9ef0351c2b4e8008a97452
# Branch: main
# Action: pull
* /usr/ports/net-p2p/awgg/Makefile
* /usr/ports/net-p2p/awgg/pkg-plist
8.349u 12.100s 21:16.81 1.6% 50+168k 144394+77637io 0pf+0w
root@mowa219-gjp4-8570p:~ # time gitup ports
# Host: git.freebsd.org
# Port: 443
# Repository: /ports.git
# Target: /usr/ports
# Have: 168a3c4e3a51e4fe8e9ef0351c2b4e8008a97452
# Want: 1c8ce0fb8ad179fc5b346e3cd92fa61798404132
# Branch: main
# Action: pull
* /usr/ports/audio/praat/Makefile
* /usr/ports/audio/praat/distinfo
7.610u 10.826s 22:03.44 1.3% 51+169k 144176+77637io 0pf+0w
root@mowa219-gjp4-8570p:~ # zpool status copperbowl
 pool: copperbowl
state: ONLINE
 scan: scrub repaired 0B in 01:40:58 with 0 errors on Thu Jan 7 02:36:19 2021
config:
 NAME STATE READ WRITE CKSUM
 copperbowl ONLINE 0 0 0
 ada0p4.eli ONLINE 0 0 0
 cache
 da1 ONLINE 0 0 0
errors: No known data errors
root@mowa219-gjp4-8570p:~ # freebsd-version -kru
14.0-CURRENT
14.0-CURRENT
14.0-CURRENT
root@mowa219-gjp4-8570p:~ #
johnmehr commented 3 years ago

Thank you for checking this out. I'll be circling back to disk performance after I get the memory footprint issues addressed. Thanks!