> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

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

# system.filesystem_cache_settings

<div id="description">
  ## 描述
</div>

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

<div id="columns">
  ## 列
</div>

* `cache_name` ([String](/docs/zh/reference/data-types/string)) — 缓存名称
* `path` ([String](/docs/zh/reference/data-types/string)) — 缓存目录路径
* `max_size` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 缓存最大大小
* `max_elements` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 缓存元素最大数量，例如 File 段 (限制文件系统上的文件数量)
* `max_file_segment_size` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 单个 File 段的最大大小
* `boundary_alignment` ([UInt64](/docs/zh/reference/data-types/int-uint)) — File 段对齐方式
* `cache_on_write_operations` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 启用直写缓存 (在 INSERT 和 MERGE 时写入缓存)
* `cache_policy` ([String](/docs/zh/reference/data-types/string)) — 缓存驱逐策略
* `slru_size_ratio` ([Float64](/docs/zh/reference/data-types/float)) — SLRU 缓存策略中受保护元素与试用元素的大小比例
* `background_download_threads` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 后台下载线程数。值为 0 时禁用后台下载
* `background_download_queue_size_limit` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 后台下载队列大小。值为 0 时禁用后台下载
* `background_download_max_file_segment_size` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 后台下载可下载的最大大小
* `load_metadata_threads` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 服务器启动时用于加载缓存元数据的最大线程数
* `load_metadata_asynchronously` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 启用在服务器启动时异步加载元数据
* `keep_free_space_size_ratio` ([Float64](/docs/zh/reference/data-types/float)) — 缓存在后台尽力维持的可用空间比例
* `keep_free_space_elements_ratio` ([Float64](/docs/zh/reference/data-types/float)) — 缓存在后台尽力维持的空闲元素比例
* `keep_free_space_remove_batch` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 后台线程为维持可用空间/元素比例而移除缓存元素时的批次大小
* `invalidated_entries_cleanup_interval_ms` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 后台任务清理已失效 (延迟移除) 的优先队列条目时的空闲间隔，单位为毫秒
* `invalidated_entries_cleanup_threshold` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 累积的已失效优先队列条目数量，达到该值时会触发后台移除
* `invalidated_entries_cleanup_remove_batch` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 每次后台迭代中，在单次写锁下移除的已失效优先队列条目的最大数量
* `enable_filesystem_query_cache_limit` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 启用对单个查询可写入缓存的最大大小的限制
* `cache_hits_threshold` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 已弃用设置
* `enable_bypass_cache_with_threshold` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 未记录。不建议使用
* `bypass_cache_threshold` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 未记录。不建议使用
* `write_cache_per_user_id_directory` ([UInt8](/docs/zh/reference/data-types/int-uint)) — ClickHouse Cloud 内部设置
* `allow_dynamic_cache_resize` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 允许动态调整文件系统缓存大小
* `max_size_ratio_to_total_space` ([Float64](/docs/zh/reference/data-types/float)) — `max_size` 与磁盘总空间的比率
* `skip_cache_on_disk_failure` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 如果为 true，则在发生磁盘 IO 错误时静默跳过文件系统缓存操作。如果为 false (默认) ，则磁盘 IO 错误会作为启动失败向上传递。
* `use_split_cache` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 使用将文件分为 system/data 的缓存方式。
* `split_cache_ratio` ([Float64](/docs/zh/reference/data-types/float)) — 在 split\_cache 中，system 分段占缓存总大小的比率。
* `overcommit_eviction_evict_step` ([UInt64](/docs/zh/reference/data-types/int-uint)) — overcommit 驱逐策略中以字节为单位的驱逐步长。用于 keep\_free\_space\_\*\_ratio 设置
* `check_cache_probability` ([Float64](/docs/zh/reference/data-types/float)) — 仅适用于 Debug 或 sanitizer 构建。通过遍历整个缓存并检查每个缓存元素的状态来验证缓存的正确性
* `expose_prometheus_eviction_metrics` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 公开文件系统缓存驱逐活动的 Prometheus 指标 (如 `filesystem_cache_evictions_total`) 。默认关闭。可在运行时通过 `SYSTEM RELOAD CONFIG` 切换。
* `expose_prometheus_eviction_metrics_per_user` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 额外公开按 user-id 统计的驱逐指标。需要 `expose_prometheus_eviction_metrics`。其基数会随发生驱逐的不同用户数量增加而增长。
* `is_initialized` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 指示缓存是否已成功初始化
* `current_size` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 当前缓存大小
* `current_elements_num` ([UInt64](/docs/zh/reference/data-types/int-uint)) — 当前缓存元素 (File 段) 数量
