Files
steamcache2/docs/examples/validate-config.yaml
T
s1d3sw1ped b7e3a0da86
Release Tag / release (push) Successful in 34s
Update metrics tracking and enhance cache eviction strategies
- Added metrics for bytes saved from cache to improve performance insights.
- Updated cache eviction strategies in MemoryFS and DiskFS to include metrics tracking for hits and evictions.
- Enhanced README.md with updated garbage collection algorithm descriptions and recommendations for cache usage.
- Introduced new madviseSequential functionality for improved memory access hints on Unix systems.
- Adjusted validation configuration in examples to better reflect realistic usage scenarios.
2026-05-28 10:31:23 -05:00

55 lines
2.3 KiB
YAML

# validate-config.yaml
#
# Small dual-tier configuration intended for full-function validation of a
# built steamcache2 binary using realistic Steam client workloads driven by
# the external SteamPrefill (https://github.com/tpill90/steam-lancache-prefill)
# "benchmark" commands.
#
# Why these values?
# - Both tiers enabled. Memory is sized large enough to survive the disk attach
# window in mixed mode (see steamcache.go: the goroutine that blocks on d.Size()
# before SetSlow). With a realistic SteamPrefill benchmark (high rate of unique
# ~1MB chunks) the old tiny 128MB mem + 512MB disk caused almost all early
# content to live only in memory, get evicted by its GC, and never reach disk.
# Result: "never hitting", hit_rate 0, memory_size 0, despite files appearing
# on disk for late-arriving chunks. Larger mem + disk makes the validation
# actually exercise hits, promotions, disk tier, and GC as intended.
# - Conservative concurrency limits suitable for a developer laptop.
# - trusted_proxies set for 127.0.0.0/8 so that an external benchmark tool
# can simulate multiple distinct clients via X-Forwarded-For if desired.
# - upstream left empty: the server will use the incoming Host header
# (exactly what happens when you point SteamPrefill at your Lancache IP).
#
# Usage (typical dev workflow):
# make build
# ./scripts/validate-with-prefill.sh
# # In another terminal:
# SteamPrefill benchmark run -c 20 ...
#
# After the benchmark run, inspect with:
# curl -s http://localhost/metrics
#
# Tweak sizes upward if you want to run very large workloads while still
# exercising the disk tier (workload >> RAM is ideal for real disk testing).
listen_address: :80
max_concurrent_requests: 1000
max_requests_per_client: 10
max_object_size: "0" # unlimited for validation (real Steam files can be large)
trusted_proxies: ["127.0.0.0/8"]
cache:
memory:
size: 1GB
gc_algorithm: largest
disk:
size: 2GB
path: ./validate-disk # ephemeral; clean between runs if you want a fresh test
gc_algorithm: hybrid # recommended for disk in the project README
# Empty upstream = use Host header from the client (SteamPrefill / real Steam clients).
# This matches the common "DNS points lancache.steamcontent.com at the cache" setup.
upstream: ""