diff --git a/python/sglang/srt/environ.py b/python/sglang/srt/environ.py index 746bce4da1..06a691994e 100644 --- a/python/sglang/srt/environ.py +++ b/python/sglang/srt/environ.py @@ -761,6 +761,8 @@ class Envs: # Per-stage timing logs for the L3 storage prefetch path (query / transfer / # ack reduce / drain / graft / load-back). Emits "HC_TIMING ..." lines. SGLANG_HICACHE_TIMING = EnvBool(False) + # Pages per batched storage IO call (query / get / put chunking). + SGLANG_HICACHE_STORAGE_BATCH_SIZE = EnvInt(128) SGLANG_HICACHE_FILE_BACKEND_STORAGE_DIR = EnvStr(None) # File-backend LRU eviction (opt-in; sizes accept SI/IEC suffixes, "0" disables). SGLANG_HICACHE_FILE_BACKEND_MAX_SIZE = EnvStr(None) diff --git a/python/sglang/srt/mem_cache/hicache_storage.py b/python/sglang/srt/mem_cache/hicache_storage.py index 04e5ab8c84..0e35b769b4 100644 --- a/python/sglang/srt/mem_cache/hicache_storage.py +++ b/python/sglang/srt/mem_cache/hicache_storage.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) # Max pages per batched storage IO call. -STORAGE_BATCH_SIZE = 128 +STORAGE_BATCH_SIZE = envs.SGLANG_HICACHE_STORAGE_BATCH_SIZE.get() @dataclass