Files
2026-02-04 20:27:13 +08:00

59 lines
2.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GoEdge CDN 缓存优化配置文件
# 此文件用于配置 TTL 缓存和文件缓存的优化参数
# TTL 缓存配置
ttl_cache:
# 分片配置
# pieces: 0 表示自动计算,> 0 表示手动指定分片数
pieces: 0
min_pieces: 64 # 最小分片数
max_pieces: 1024 # 最大分片数
# GC 配置
gc:
base_interval: 2s # 基础 GC 间隔
min_interval: 1s # 最小 GC 间隔(过期率高时使用)
max_interval: 10s # 最大 GC 间隔(过期率低时使用)
adaptive: true # 是否启用自适应 GC
sample_size: 100 # 过期率采样大小
# 文件缓存配置
file_cache:
# SSD 检测配置
auto_detect_ssd: true # 是否自动检测 SSD
ssd_paths: [] # 手动指定 SSD 路径(可选,如:["/mnt/ssd1", "/mnt/ssd2"]
# SSD 优化策略
ssd:
hot_item_threshold: 100 # 访问次数超过此值视为热点数据
write_buffer_size: 128KB # 写入缓冲区大小SSD 随机写性能好)
read_ahead_size: 256KB # 预读大小
sync_interval: 10s # 同步间隔SSD 不需要频繁同步)
open_file_cache_max: 10000 # 文件句柄缓存最大值
# HDD 配置
hdd:
write_buffer_size: 64KB # 写入缓冲区大小
read_ahead_size: 128KB # 预读大小
sync_interval: 1s # 同步间隔
open_file_cache_max: 5000 # 文件句柄缓存最大值
# 内存缓存配置
memory:
# 内存缓存容量(系统内存的百分比)
# 如果未设置将根据系统内存自动计算10-20%
capacity_percent: 15 # 默认 15%,可配置 10-30%
# 小文件阈值
small_file_threshold: 1MB # 1MB 以下视为小文件
medium_file_threshold: 10MB # 10MB 以下视为中等文件
# 小文件内存缓存策略
small_file_memory_cache: true # 小文件强制使用内存缓存
# 淘汰策略
eviction_policy: "lfu_lru" # 淘汰策略lfu, lru, lfu_lru
preserve_hot_items: true # 保留热点数据
preserve_recent_items: true # 保留最近访问的数据