修改成redis

This commit is contained in:
2026-04-20 18:26:54 +08:00
parent e944a25e56
commit a9cb0b2481
17 changed files with 2408 additions and 933 deletions
+115
View File
@@ -0,0 +1,115 @@
# ============================================
# sese-engine 配置文件示例
# ============================================
index:
max_urls_per_key: 11000 # 每个关键词最大URL数量
max_same_domain_per_key: 20 # 每个关键词同域名最大数量
big_clean_threshold: 2000000 # 大清理阈值
max_new_urls_per_key: 10000 # 每个关键词最大新增URL
min_urls_for_new_key: 3 # 新关键词最小URL数量
crawler:
spider_name: "Haibara_AI_spider" # 爬虫名称
cooldown: 3 # 请求间隔(秒)
workers: 22 # 并发数
crawl_focus: 0.7 # 爬取聚焦系数
max_keywords_per_page: 250 # 每页最大关键词数
max_epoch: 100 # 最大轮数
expected_prosper_ratio: 0.6 # 期望繁荣值比例
entry_url: "https://haibara.ai/" # 入口URL
max_page_size: 5242880 # 单页最大5MB
recrawl_max_age: 2592000 # 重爬过期30天
recrawl_check_interval: 3600 # 检查间隔1小时
recrawl_batch_size: 500 # 每批500个
max_priority_children: 100 # 优先队列子链接上限
search:
use_online_snippet: true
online_snippet_timeout: 3
weight_daily_decay: 0.996
language_weight: 0.5
consecutive_key_weight: 1.3
backlink_weight: 1.0
server_port: 50082
flush_interval_seconds: 300
stats_refresh_interval: 30
miss_penalty: 0.15
unix_socket: "" # Unix Socket路径(可选)
backlink:
baseline: 200000 # 反链基准值
storage:
path: "./savedata" # 存储路径
# ============================================
# MySQL 配置(默认关闭,启用时需设置 enabled: true
# ============================================
# 支持两种连接方式:Unix Socket 和 TCP
# 优先级:UnixSocket > TCP(如果UnixSocket非空则优先使用)
mysql:
# 是否启用 MySQL(默认 false,不启用则不连接、不刷盘)
enabled: false
# 连接方式(可选,默认tcp,可设为 "socket" 或 "tcp"
# network: "tcp"
# ----- Unix Socket 连接(推荐,本地MySQL性能更好)-----
# 设置为 MySQL socket 路径即可,TCP配置将被忽略
unix_socket: "/var/run/mysqld/mysqld.sock"
# unix_socket: "/tmp/mysql.sock" # macOS 常见路径
# unix_socket: "" # 留空则使用TCP连接
# ----- TCP 连接 -----
host: "localhost"
port: 3306
# ----- 认证信息 -----
user: "root"
password: "your_password_here"
database: "sese_engine"
# ----- 连接池配置 -----
conn_max_lifetime: 3600 # 连接最大生命周期(秒),默认1小时
max_idle_conns: 10 # 最大空闲连接数
max_open_conns: 100 # 最大打开连接数
# ============================================
# Redis 配置
# ============================================
# 支持两种连接方式:Unix Socket 和 TCP
# 优先级:UnixSocket > TCP(如果UnixSocket非空则优先使用)
redis:
# 连接方式(可选,默认tcp
# network: "tcp"
# ----- Unix Socket 连接(推荐,本地Redis性能更好)-----
# 设置为 Redis socket 路径即可,TCP配置将被忽略
unix_socket: "/var/run/redis/redis.sock"
# unix_socket: "/tmp/redis.sock" # macOS 常见路径
# unix_socket: "" # 留空则使用TCP连接
# ----- TCP 连接 -----
host: "localhost"
port: 6379
# ----- 认证信息(无密码则留空)-----
password: ""
# ----- 数据库配置 -----
# 数据库编号(0-15),默认使用15号数据库
db: 15
# ----- 连接池配置 -----
pool_size: 100 # 连接池最大连接数
min_idle_conns: 10 # 最小空闲连接数
# ----- 超时配置(毫秒)-----
read_timeout: 500 # 读超时
write_timeout: 500 # 写超时
prometheus:
crawler_port: 14950
backlink_port: 14952
search_port: 14953