Reference

kvblockd configuration reference

Every daemon setting with its built-in default. An empty config file, or none at all, runs with exactly these values. Byte sizes are plain integers.

Last updated

How settings load

Later sources win: built-in defaults, then the YAML file given with --config, then KVBLOCKD_ environment variables, then command-line flags. The daemon validates the result before it opens any port, and an invalid value is an error with a message; it never quietly clamps a setting to something else.

Shell
kvblockd --config /etc/kvblockd/config.yaml --listen 10.0.0.5:9440

Annotated examples: the quickstart config for one machine, and a full three-tier config.

Listeners

An empty address turns a listener off, except listen_addr.

  • listen_addrdefault: ":9440"

    Data plane for engines and kvbctl. Plain TCP with bearer tokens; the daemon warns when it binds beyond loopback. Keep it on a private network.

  • admin_addrdefault: ""

    Admin plane for adding namespaces and setting quotas at runtime. Off by default; set it to "127.0.0.1:9441" to turn it on. Loopback only: any other address is refused at startup. Needs admin_token_file.

  • admin_token_filedefault: ""

    File holding the admin bearer token, required when admin_addr is set. At least 32 non-whitespace bytes (openssl rand -hex 32 makes one), otherwise the daemon refuses to start. kvbctl reads the same file with -admin-token-file or KVB_ADMIN_TOKEN_FILE.

  • metrics_addrdefault: "127.0.0.1:9442"

    /metrics and /healthz. "" turns it off.

  • pprof_addrdefault: ""

    Go profiler on its own listener. Loopback only; off by default.

  • s3compat_addrdefault: ""

    S3-compatible endpoint for NIXL object clients, for example "127.0.0.1:9500". Bucket = namespace; bearer tokens, or SigV4 with a namespace's s3_credentials. Off by default.

Protocol limits

Ceilings the daemon offers each client when it connects. Validation enforces the protocol floors (128 keys, 16 MiB frame, 4 MiB block, 16 MiB credit); a value below a floor is an error at startup, never silently raised.

  • max_batch_keysdefault: 512

    Keys per batched request.

  • max_frame_lendefault: 268435456

    Largest frame, 256 MiB.

  • max_blob_lendefault: 33554432

    Largest block, 32 MiB.

  • initial_creditdefault: 134217728

    Bytes a client may have in flight before it must wait for credit, 128 MiB.

  • stream_timeout_msdefault: 30000

    An unfinished write stream idle this long is aborted. Floor 5000.

  • lease_default_msdefault: 5000

    Read lease granted automatically to every block a read returns.

  • lease_max_msdefault: 60000

    Longest lease a client can request.

Tenancy and network

  • namespaces_pathdefault: ""

    The namespaces and tokens file. Empty means no namespaces: every connection is refused until some are added. Resolved from the working directory, so use an absolute path.

  • max_connsdefault: 1024

    Open connections across all clients.

  • sock_sndbufdefault: 16777216

    Send buffer requested per connection, 16 MiB. Hosts cap it at net.core.wmem_max; the daemon logs what it got.

  • sock_rcvbufdefault: 16777216

    Receive buffer requested per connection, 16 MiB. Capped at net.core.rmem_max.

  • write_chunk_bytesdefault: 1048576

    Bytes per write call within one coalesced flush, 1 MiB. 0 writes unchunked.

Memory budgets

Caps on the daemon's own buffers outside the arena, each a global total and a per-namespace share. 0 selects the default shown, never unlimited. A request that would exceed one waits briefly for earlier ones to drain, then answers ERR_BUSY.

  • put_staging_bytesdefault: 0 (512 MiB)

    Buffers holding incoming writes, all namespaces.

  • put_staging_tenant_bytesdefault: 0 (256 MiB)

    The same, per namespace.

  • wire_receive_bytesdefault: 0 (512 MiB)

    Request input buffers, all namespaces.

  • wire_receive_tenant_bytesdefault: 0 (256 MiB)

    The same, per namespace.

  • wire_response_bytesdefault: 0 (512 MiB)

    Responses queued for sending, all namespaces.

  • wire_response_tenant_bytesdefault: 0 (256 MiB)

    The same, per namespace. Raise it with large parallel reads from one namespace.

  • nvme_read_bytesdefault: 0 (512 MiB)

    Blocks read from NVMe and not yet sent, all namespaces.

  • nvme_read_tenant_bytesdefault: 0 (256 MiB)

    The same, per namespace.

  • s3_response_bytesdefault: 0 (512 MiB)

    Blocks read from S3 and not yet sent, all namespaces.

  • s3_response_tenant_bytesdefault: 0 (256 MiB)

    The same, per namespace.

DRAM and eviction

  • dram_arena_bytesdefault: 1073741824

    Size of the hot tier, 1 GiB. Must hold at least one max_blob_len block.

  • dram_hugepagesdefault: false

    Map the arena on 2 MiB hugepages (Linux). Falls back to normal pages with a warning if none are reserved.

  • pinned_bytes_capdefault: 134217728

    Default pinned bytes per namespace, 128 MiB. 0 = unlimited. A namespace's pin_quota overrides it. Unset, it is lowered to the arena when the arena is smaller (0.2.2 and later); a value you set must not exceed dram_arena_bytes.

  • eviction_policydefault: "s3fifo"

    s3fifo, sampled-lru, or none. With none, a full arena refuses writes with ERR_QUOTA_BYTES.

  • eviction_watermark_pctdefault: 95

    Start an eviction batch at this arena occupancy.

  • eviction_batch_pctdefault: 5

    Each batch frees this much: 95 - 5 = down to 90%.

  • eviction_ghost_entriesdefault: 0

    History entries per tenant for S3-FIFO. 0 = sized from the arena.

NVMe tier

Off while nvme_paths is empty; a DRAM-only daemon behaves exactly as if these keys did not exist.

  • nvme_pathsdefault: []

    One directory per physical device. Append only: order defines ownership across restarts. Exactly one when the S3 tier is on.

  • nvme_max_bytesdefault: 0

    Total budget across volumes. Required when nvme_paths is set, and must be more than two segments (512 MiB) per volume.

  • nvme_segment_bytesdefault: 268435456

    Append-only segment size, 256 MiB. One sealed segment becomes one S3 object.

  • nvme_read_workersdefault: 16

    Device readers per volume. When all are busy, extra keys answer ERR_BUSY instead of waiting.

  • nvme_demote_watermark_pctdefault: 90

    Demote from DRAM at this occupancy. From 50 up to below eviction_watermark_pct. Lower it (for example 60, with nvme_demote_batch_pct 20) when writes come in bursts, so they do not reach the eviction mark before demotion.

  • nvme_demote_batch_pctdefault: 5

    Each pass demotes down to 85%.

  • nvme_admit_min_hitsdefault: 1

    Blocks with fewer reads than this are dropped at demotion instead of written to flash. 0 admits everything.

  • nvme_promote_window_msdefault: 60000

    A second NVMe hit within this window moves the block back to DRAM. 0 never promotes.

  • nvme_sync_every_bytesdefault: 8388608

    Group commit: fdatasync after this many bytes, 8 MiB.

  • nvme_ckpt_every_segmentsdefault: 8

    Write an index checkpoint every 8 sealed segments. 0 never checkpoints; recovery then scans segment footers.

S3 tier

Off while s3_bucket is empty. Requires the NVMe tier with exactly one volume, and an unversioned bucket. Credentials come only from the AWS environment chain (variables, shared config, instance or pod role), never from this file.

  • s3_bucketdefault: ""

    Bucket name. Setting it turns the tier on.

  • s3_regiondefault: ""

    Bucket region. Always required, also with s3_endpoint_override (most S3-compatible stores accept us-east-1); AWS_REGION is not read.

  • s3_node_iddefault: ""

    Required with s3_bucket. Prefix for this daemon's objects; unique per daemon and stable across its restarts. Letters, digits, dot, underscore and hyphen only.

  • s3_endpoint_overridedefault: ""

    S3-compatible endpoint, for example "http://minio:9000".

  • s3_path_styledefault: false

    Path-style addressing, needed by MinIO and most non-AWS stores.

  • s3_spill_queuedefault: 8

    Uploads queued at once. On overflow the segment stays local and is retried.

  • s3_read_timeout_msdefault: 2000

    Deadline for a cold ranged read. A slower read answers as a miss.

Environment variables

These override the file and are convenient in containers. Other settings are file-only.

VariableSets
KVBLOCKD_LISTEN_ADDRlisten_addr
KVBLOCKD_METRICS_ADDRmetrics_addr
KVBLOCKD_PPROF_ADDRpprof_addr
KVBLOCKD_S3COMPAT_ADDRs3compat_addr
KVBLOCKD_NAMESPACESnamespaces_path
KVBLOCKD_MAX_CONNSmax_conns
KVBLOCKD_DRAM_ARENA_BYTESdram_arena_bytes
KVBLOCKD_DRAM_HUGEPAGESdram_hugepages
KVBLOCKD_PINNED_BYTES_CAPpinned_bytes_cap
KVBLOCKD_NVME_PATHSnvme_paths
KVBLOCKD_NVME_MAX_BYTESnvme_max_bytes

KVBLOCKD_NVME_PATHS takes a comma-separated list. AWS credentials and region for the S3 tier come from the standard AWS_ variables.

Command-line flags

  • --config PATH

    Config file. Without it the daemon runs on built-in defaults.

  • --listen ADDR

    Overrides listen_addr.

  • --namespaces PATH

    Overrides namespaces_path.

  • --version

    Prints the version and exits.

Something missing or wrong on this page? Email rudray@kvstash.com and it gets fixed.