跳转到主要内容

描述

包含所有文件系统缓存设置的相关信息

  • cache_name (String) — 缓存名称
  • path (String) — 缓存目录路径
  • max_size (UInt64) — 缓存最大大小
  • max_elements (UInt64) — 缓存元素的最大数量,例如 File 段 (限制文件系统中的文件数量)
  • max_file_segment_size (UInt64) — 单个 File 段的最大大小
  • boundary_alignment (UInt64) — File 段边界对齐
  • cache_on_write_operations (UInt8) — 启用直写缓存 (在 INSERT 和 MERGE 时缓存)
  • cache_policy (String) — 缓存淘汰策略
  • slru_size_ratio (Float64) — SLRU 缓存策略中保护区元素与试用区元素的大小比例
  • background_download_threads (UInt64) — 后台下载线程数。值为 0 时禁用后台下载
  • background_download_queue_size_limit (UInt64) — 后台下载队列大小。值为 0 时禁用后台下载
  • background_download_max_file_segment_size (UInt64) — 后台下载允许的最大大小
  • load_metadata_threads (UInt64) — 服务器启动时用于加载缓存元数据的最大线程数
  • load_metadata_asynchronously (UInt8) — 启用在服务器启动时异步加载元数据
  • keep_free_space_size_ratio (Float64) — 缓存在后台尝试维持的空闲空间比例
  • keep_free_space_elements_ratio (Float64) — 缓存在后台尝试维持的空闲元素比例
  • keep_free_space_remove_batch (UInt64) — 由维持空闲空间/元素比例的后台线程执行的缓存元素单次移除批次大小
  • enable_filesystem_query_cache_limit (UInt8) — 启用对单个查询内可写入缓存的最大大小进行限制
  • cache_hits_threshold (UInt64) — 已弃用设置
  • enable_bypass_cache_with_threshold (UInt8) — 未文档化。不建议使用
  • bypass_cache_threshold (UInt64) — 未文档化。不建议使用
  • write_cache_per_user_id_directory (UInt8) — ClickHouse Cloud 内部设置
  • allow_dynamic_cache_resize (UInt8) — 允许动态调整文件系统缓存大小
  • dynamic_resize_lock_wait_ms (UInt64) — 在跳过本次调整大小尝试之前,获取动态调整大小独占锁的超时时间 (毫秒)
  • max_size_ratio_to_total_space (Float64) — max_size 占磁盘总空间的比例
  • skip_cache_on_disk_failure (UInt8) — 如果为 true,则在发生磁盘 IO 错误时静默跳过文件系统缓存操作。如果为 false (默认) ,则磁盘 IO 错误会向上传播为启动失败。
  • use_split_cache (UInt8) — 使用 system/data 文件分离。
  • split_cache_ratio (Float64) — 在 split_cache 中,system 分段占缓存总大小的比例。
  • overcommit_eviction_evict_step (UInt64) — overcommit 淘汰策略的淘汰步长 (以字节为单位) 。用于 keep_free_space_*_ratio 设置
  • check_cache_probability (Float64) — 仅适用于 debug 或 sanitizer build。会遍历整个缓存并检查每个缓存元素的状态,以验证缓存正确性
  • is_initialized (UInt8) — 表示缓存是否已成功初始化
  • current_size (UInt64) — 当前缓存大小
  • current_elements_num (UInt64) — 当前缓存元素 (File 段) 数量
最后修改于 2026年6月10日