lmcache server#

The lmcache server command launches the standalone LMCache Multi-Process (MP) server, which exposes a configurable ZMQ or gRPC request endpoint and an HTTP frontend (status, healthcheck, cache-clear, checksum APIs). It is the server that lmcache describe, lmcache ping kvcache, lmcache kvcache, and lmcache bench server talk to.

备注

此命令需要完整的 lmcache 安装,并带有 CUDA 扩展。它在轻量级的 lmcache-cli 包中 不可用

lmcache server [options]

快速开始#

lmcache server \
    --host 0.0.0.0 --port 5555 \
    --l1-size-gb 100 \
    --eviction-policy LRU

选项#

服务器从多个配置模块组合其参数——多进程服务器、存储管理器(L1 / L2 适配器 / 逐出)、HTTP 前端以及 Prometheus / 监控可观察性层。完整的权威列表很大,并随着运行时而变化,因此请参考:

lmcache server --help

常用的标志包括:

标志

描述

--transport {zmq,grpc}

Request transport exposed by the server (default: zmq).

--host HOST

服务器的绑定地址。

--port PORT

Request-transport port.

--chunk-size N

KV Cache 块大小(以 token 为单位)。

--l1-size-gb GB

L1 (CPU/DRAM) 缓存容量(以 GB 为单位)。

--eviction-policy POLICY

L1 eviction policy (LRU, ARC, IsolatedLRU, or noop).

--eviction-trigger-watermark RATIO

开始逐出的 L1 填充比率。

--eviction-ratio RATIO

每个逐出周期清除的 L1 分数。

--max-workers N

Base number of request worker threads.

--grpc-server-workers N

gRPC dispatch threads (used only with --transport grpc).

--coordinator-url URL

在此基础 URL(例如 http://coordinator:9300)注册 MP 协调器。可选;启用车队注册。请参见 多服务器协调

--coordinator-advertise-ip IP

协调器应通过此服务器访问的 IP(默认为出站 IP)。

--coordinator-heartbeat-interval SECONDS

心跳之间的秒数(> 0,默认值为 5)。应远低于协调器的实例超时。

--coordinator-event-reporting

Stream cache store/access/delete events to the coordinator, feeding the key directory (fleet-wide placement tracking), L2 usage/quota tracking and eviction, and the blend index behind fleet CacheBlend matching.

--coordinator-event-flush-interval SECONDS

Seconds between cache-event batch flushes (> 0, default 1).

--coordinator-event-transport {http,kafka}

Cache-event transport (default http). kafka publishes each batch to a Kafka topic instead of POST /events; it needs the optional lmcache[kafka] extra. See 多服务器协调.

--coordinator-kafka-bootstrap-servers SERVERS

Comma-separated Kafka bootstrap servers. Required with --coordinator-event-transport kafka.

--coordinator-kafka-topic TOPIC

Kafka topic receiving cache events (default lmcache-cache-events).

--coordinator-kafka-delivery-timeout SECONDS

Seconds one flush waits for broker acknowledgement (> 0, default 10).

--p2p-advertise-url HOST:PORT

启用 P2P KV Cache 共享,并将此服务器的传输通道端点广告给对等方(例如 10.0.0.1:8500)。设置它会开启 P2P;此外还需要 --coordinator-url 进行对等发现。请参见 P2P KV 缓存共享

--p2p-listen-url 主机:端口

传输通道服务器绑定的地址。默认为 --p2p-advertise-url。当广告地址与绑定地址不同(例如,绑定 0.0.0.0 而广告一个可路由的 IP)时,请设置它。

--p2p-lookup-timeout SECONDS

对等查找的截止时间,超过该时间将视为未命中(默认 30)。

--p2p-load-timeout SECONDS

对等 KV 读取的截止时间,超过该时间将视为失败(默认 30)。

--p2p-transfer-engine ENGINE

P2P 读取的传输通道实现(默认 nixl)。

--trace-level {storage}

启用存储级别的追踪记录(请参见 lmcache trace)。

--trace-output PATH

记录的 .lct 跟踪文件的目标。

L2 适配器、可观察性和 Prometheus 导出器通过各自的标志组进行配置;有关完整的设置,请参见 lmcache server --help