Systems Tuning
Varnish 7.x malloc RAM vs File Storage Sizing on NVMe VPS
Compare -s malloc RAM allocation against -s file NVMe caching to avoid memory fragmentation, LRU churn, and Linux page-cache double buffering.
malloc 1-2 GB RAM · <12 ms Hit TTFB · Zero Double Buffering
Avoiding Cache Pollution From Marketing Query Parameters
Every unique fbclid, gclid, or utm_campaign URL creates a separate cache key unless stripped in vcl_recv, rapidly exhausting a 1 GB malloc pool. Always normalize tracking query strings before return (hash).
Monitoring Hit Ratio & LRU Evictions
Run varnishstat -1 -f MAIN.cache_hit -f MAIN.cache_miss -f MAIN.n_lru_nuked; non-zero n_lru_nuked counters indicate your malloc ceiling is too small for the active URL working set.
Measured Parameters & CloudPanel Stack Directives
| Storage Backend | RAM & Disk Behavior | Best Multi-Site Fit |
|---|---|---|
| -s malloc,1G (or 2G) | Locks hot objects directly in virtual RAM | 5-40 WordPress/Woo sites on 8-32 GB KVM/HF nodes |
| -s file,/var/lib/varnish/cache,8G | Maps cache file via OS page cache on NVMe | Massive static asset catalogs exceeding available RAM |
| n_lru_nuked Metric | Target 0 nuked objects/minute | If >0, double malloc size or strip noisy query params |
| Workspace Reserve | +140 MB thread/workspace overhead | Accounted automatically alongside malloc size in our Studio |