Reference
Troubleshoot KVStash
Because engines fail open, most problems show up as missing speedups rather than errors. Start with three checks, then find your symptom below.
Last updated
Check these first
curl -s STORE_HOST:9442/healthz # from the engine host: ok
curl -s STORE_HOST:9442/metrics | grep -E '^kvb_(auth_failures_total|bytes_total|hits_total|misses_total)'
kvbctl stats -addr STORE_HOST:9440 -ns NAMESPACE # token from KVBCTL_TOKEN - Reachable?
/healthzanswersokfrom the engine host. If not, it is the network, the bind address, or the daemon is still starting. - Accepted?
kvb_auth_failures_totalstays flat. If it rises, a token or namespace is wrong. - Used?
kvb_bytes_total{dir="in"}rises on new prompts andkvb_hits_totalon repeated ones.
The daemon will not start
Configuration errors stop the daemon before it opens a port, with a message naming the setting.
- nvme_paths is set without a budget
Set nvme_max_bytes. It must exceed two segments per volume (512 MiB per volume at the default segment size), so reclaim has room to work, and fit in the space on the volumes.
- admin_addr or pprof_addr is not loopback
Both listeners only accept loopback addresses, by design. Use 127.0.0.1 and tunnel in for remote use.
- s3_bucket without the NVMe tier, or without s3_node_id
The S3 tier spills NVMe segments and needs a unique node id. Configure nvme_paths and s3_node_id.
- pin_quota larger than the arena, or a duplicate namespace id
Lower the pin quota to at most dram_arena_bytes; give each namespace its own id.
- nvme_demote_watermark_pct out of range
With the NVMe tier on, it must be at least 50 and below eviction_watermark_pct, so demotion starts before eviction. The defaults are 90 and 95.
- A value below a protocol floor
The message names the key and the floor. Raise it; the daemon does not adjust values for you.
Engines never hit the store
- Every connection is refused; kvb_auth_failures_total rises
Wrong token or namespace name, or the namespaces file was not loaded. namespaces_path is resolved from the working directory: use an absolute path, and check the file in a container mount.
- kvb_bytes_total{dir="in"} never rises
The engine did not load the adapter. Look for the connector line in the engine log (see the setup page for your engine) and check the JSON quoting of the setting.
- Writes arrive, but a restarted or second engine gets no hits
Something that feeds the keys differs: model revision, KV precision, block or page size, namespace, or PYTHONHASHSEED. Every worker needs PYTHONHASHSEED=0. After changing block size, blocks written before are not hits by design.
- Hits for a while, then none
The working set outgrew DRAM and blocks were evicted. Check kvb_evictions_total; add DRAM or an NVMe tier.
- Engines serve normally but the store sees nothing at all
Adapters fail open: an unreachable daemon looks like a store with no data. Check /healthz from the engine host and the firewall for port 9440.
Reads are slow
- Warm reads far below the network
Measure the link with iperf3 -P 8, apply the host tuning sysctls, and check the socket buffer sizes the daemon logs when a client connects. Use several streams per engine (8 and 8 in our vLLM runs).
- kvb_get_busy_total or kvb_nvme_read_busy_total rising
NVMe readers are saturated and extra keys answer as misses. Raise nvme_read_workers, add devices, or give DRAM more room so hot blocks stay there.
- Latency spikes at startup
Normal while the arena pre-faults and the NVMe index recovers; /healthz answers 503 until ready. kvb_nvme_recovery_seconds shows how long recovery took.
- Hugepages requested but not used
The startup line arena ready ... hugepages=false means no pages were reserved. Set vm.nr_hugepages before starting the daemon.
NVMe and S3
- NVMe fills slowly or not at all; kvb_nvme_admit_refusals_total is high
Blocks never read while in DRAM are dropped at demotion to spare the SSD, which behind an engine cache is most of them. Set nvme_admit_min_hits to 0, which is also right for bulk pre-loading; the NVMe tier page explains the trade-off.
- Blocks missing after a write burst; kvb_nvme_dram_only_evictions_total rising
Writes reached the eviction mark before demotion moved them to flash. Start demoting earlier: nvme_demote_watermark_pct 60 with nvme_demote_batch_pct 20. The NVMe tier page has the measurements.
- The daemon logs a fallback to buffered I/O
The volume refuses direct I/O (tmpfs, overlay). Fine for tests; use a real filesystem on the device for production.
- Permission denied on an NVMe directory under systemd
Add the directory to ReadWritePaths in the unit and chown it to the kvblockd user.
- S3 storage keeps growing
Add the bucket lifecycle expiration rule. Restarts leave objects behind by design.
- kvb_s3_read_errors_total rising
Cold reads time out or fail: check region, credentials in the environment, network to S3, and s3_read_timeout_ms (2 s by default).
- kvb_s3_put_errors_total rising
Uploads fail: usually missing s3:PutObject permission or a wrong bucket region. Segments stay on NVMe meanwhile.
Engine-specific
Full settings for each engine are on the vLLM, SGLang and LMCache setup pages.
- vLLM: DeterminismError at startup
Export PYTHONHASHSEED=0 on every worker.
- SGLang: TypeError: int() argument must be ... not NoneType, from sglang_kvblockd keymap.py
sglang-kvblockd 0.1.0 predates SGLang 0.5.16+, which passes tp_lcm_size as None. Upgrade: pip install -U sglang-kvblockd (0.2.1), then add the identity values from python -m sglang_kvblockd.identity to the extra config.
- LMCache: Ping failed with error code: 1, then HealthMonitor: System unhealthy, entering degraded mode
lmcache-kvblockd 0.1.0 reports a healthy daemon with the wrong code, so LMCache 0.5.6+ stops using it and nothing is stored. Upgrade: pip install -U lmcache-kvblockd (0.2.1).
- LMCache: kvblockd plugin disabled: LMCache's compiled lmcache.cuda_ops extension is not importable
Without its compiled kernels LMCache would hand the plugin wrong KV (vLLM 0.26 and newer), so the plugin stays off; LMCache then stops caching and keeps serving. Install an LMCache build compiled for your torch version, or use the native vllm-kvblockd connector.
- vLLM: requests with prompt embeddings never hit the store
Expected. Their embedding positions carry placeholder token ids, so the connector (0.1.2 and newer) neither stores nor loads them; vLLM's own prefix cache still applies.
- SGLang: ERROR declared kv_dtype ... bytes per element but the host pool holds ...
The identity says one KV dtype and the engine runs another, often an fp8 KV cache with the identity generated without --kv-dtype. Every operation misses until you regenerate the identity with the engine's --kv-cache-dtype.
- SGLang: ValueError: SGLang cache identity requires model_revision (or another identity field)
sglang-kvblockd 0.2.0 needs the five identity values. Generate them with python -m sglang_kvblockd.identity MODEL --dtype ... --kv-dtype ... --page-size ... and merge the JSON into --hicache-storage-backend-extra-config.
- vLLM: the connector refuses to start with tensor parallelism
The connector supports one GPU per engine for now. Run with tensor parallel size 1.
- vLLM: ImportError mentioning fastokens
VLLM_USE_FASTOKENS=1 is set but the package is missing. Install it or unset the variable.
- LMCache: no remote hits, no errors
Put the endpoint in extra_config as remote_storage_plugin.kvblockd.url, not remote_url, and do not set both. The engine log should show Created remote backend for plugin: kvblockd.
- LMCache: the config file seems ignored
There is no lmcache_config_file key. Export LMCACHE_CONFIG_FILE in the serving process, or pass the settings inline with lmcache. prefixed keys.
- SGLang: the backend logs an error and every read misses
The host memory layout must be page_first with --page-size 64, the setup we test.
- SGLang: reuse stays low even with zero store misses
SGLang stages every page through its host-memory pool. Raise --hicache-size; in our load test 16 GB to 48 GB took reuse from 33-45% to 99%.
- Any engine: connection refused while the daemon restarts
Expected. Adapters reconnect on their own and hits resume once the daemon is ready.
Still stuck? Email the symptom, the daemon's startup log and the output of the three checks to rudray@kvstash.com.
Something missing or wrong on this page? Email rudray@kvstash.com and it gets fixed.