afpd: default dircache mode to ARC - #3265
Conversation
|
augment review |
|
Looks like you're out of credits for this review. Head to your account settings to top up and keep reviews running. https://app.augmentcode.com/account/subscription |
6c87bc8 to
3d02d96
Compare
|
@rdmark ready for review |
rdmark
left a comment
There was a problem hiding this comment.
sounds reasonable to make ARC the default now 👍
|
@dependabot rebase |
I do this sometimes too on my own PRs :-D |
ARC delivers 10-50% better hit ratios than LRU (2x on sequential scans) and has shipped opt-in for a full release cycle. ARC can use up to 2x the memory (~24 MB vs ~12 MB at the 64K default): evicted entries may be retained as ghosts for instant re-promotion; cold ghosts are dropped. With the correctness work merged the conservative-default question flips: a config that says nothing now gets the well-tested fast path, and memory-constrained systems opt down with 'dircache mode = lru'. The docker entrypoint's generated afp.conf now emits 'dircache mode' only when AFP_DIRCACHE_MODE is set, so containers inherit the compiled default instead of a hardcoded fallback.
3d02d96 to
b8b5655
Compare
|
📊 Performance DashboardCommit: 🔥 Spectest (AFP 3.4) - FlameGraphNetatalk Code-time: 3.7% · Runtime: 60s · Stacks: 744 🔥 Click the preview to open the interactive flamegraph (zoom + search). 🔝 Top 10 leaf functions
📈 Speedtest (AFP 3.4) - PerfGraphPeak Read: 6723 MB/s (-6.8% vs hist avg 7212.7 MB/s; min 5963 / max 9526 over 27 PRs) 🔝 Throughputs per operation (vs. historical average)
⏱️ Lantest (AFP 3.4) - LatencyGraphAvg total runtime: 4365 ms (+1.2% vs hist avg 4314.0 ms; min 2416 / max 5208 over 27 PRs) 🐢 All operations (avg runtime, in test order, vs. historical average)
Run baseline: median op-test delta +8.5%, MAD 5.9%. Adj Δ% shifts each delta by the median; standouts ≥5% in bold. A large MAD means the run did not move uniformly — read the adjusted column with caution. |







What changes
A configuration that says nothing about
dircache modenow gets ARC instead of LRU. Explicitdircache mode = lruremains the opt-out and behaves exactly as before; explicitarcis unchanged. An invalid value now falls back to ARC (previously LRU), with the warning message updated to match.ARC has shipped opt-in for a full release cycle and delivers 10-50% better hit ratios than LRU (2× on sequential scans). With the cache-correctness work merged, the conservative-default question flips: the safe choice is to give every server the well-tested fast path and let memory-constrained systems opt down.
Memory: what ARC actually costs
LRU and ARC use the same amount of memory for the same number of live entries. ARC can use up to 2× (~24 MB vs ~12 MB at the 64K default) because instead of dropping an evicted entry outright it may keep it as a ghost — signalled as expired, but retained — so a ghost that is referenced again is promoted back to a full entry without rebuilding it from disk. Ghosts that stay cold are truly dropped.
The man page entry previously overstated this as "ARC uses approximately 2× memory (~100% overhead)"; it now describes the ghost mechanics and frames 2× as the ceiling, not the steady state.
Defect → fix
lru→arc; invalid-value fallbacklru→arc(warning text updated)libatalk/util/netatalk_conf.c(default: *lru*)→(default: *arc*); body rewritten with the ghost/promotion mechanics; recommendation rewordeddoc/manpages/man5/afp.conf.5.mdlru→arccontrib/webmin_module/netatalk-lib.pldircache mode = ${AFP_DIRCACHE_MODE:-lru}, which would have shadowed the new compiled default in every container; now emits the key only whenAFP_DIRCACHE_MODEis set (same idiom as thestrict lockingline in the same heredoc)distrib/docker/env_setup_netatalk.shNEWS.mdBehaviour changes
AFP_DIRCACHE_MODEunset: previously wrote an explicitlruinto afp.conf; now inherits the compiled default (arc). CI legs set the variable explicitly and are unaffected.Testing
meson test(Alpine container, CI build flags): 3/3 suites, zero failures.