perf: 收敛后端资源与健康检查开销

- 缩小模块扫描范围并显式注册各业务模块自动配置

- 增加可配置线程池、MQ 连接池与消费线程池,降低默认资源占用

- 将 RAG 与分析库中间件探活下沉到健康检查并增加短缓存

- 补齐文档向量库生命周期释放与 SSE 断连清理
This commit is contained in:
2026-05-28 11:22:14 +08:00
parent 72df00f25b
commit 11e595b088
43 changed files with 1343 additions and 288 deletions

View File

@@ -6,6 +6,13 @@ spring:
url: jdbc:mysql://127.0.0.1:23306/easyflow?useInformationSchema=true&characterEncoding=utf-8
username: easyflow
password: root
hikari:
maximum-pool-size: 20
minimum-idle: 4
connection-timeout: 5000
validation-timeout: 3000
idle-timeout: 600000
max-lifetime: 1800000
data:
redis:
host: 127.0.0.1
@@ -37,6 +44,15 @@ easyflow:
consumer-block-timeout: 2000ms
pending-claim-idle: 60000ms
max-retry: 16
consumer-executor:
core-size: 4
max-size: 12
queue-capacity: 64
keep-alive-seconds: 60
pool:
max-active: 12
max-idle: 8
min-idle: 1
analytical-db:
enabled: true
url: ${EASYFLOW_ANALYTICAL_DB_URL:jdbc:clickhouse://127.0.0.1:8123/easyflow?jdbc_ignore_unsupported_values=true&socket_timeout=30000&compress=false&ssl=false}
@@ -58,3 +74,27 @@ easyflow:
validate-on-migrate: true
storage:
type: xFileStorage
ai:
rag:
health:
cache-ttl: 5s
document-import:
parse-monitor:
fixed-delay: 10000
initial-delay: 10000
batch-size: 10
thread-pool:
sse:
core-size: 4
max-size: 16
queue-capacity: 2000
keep-alive-seconds: 30
allow-core-thread-timeout: true
document-import:
core-size: 2
max-size: 4
queue-capacity: 200
keep-alive-seconds: 60
allow-core-thread-timeout: true
scheduler:
pool-size: 4

View File

@@ -21,6 +21,13 @@ spring:
url: jdbc:mysql://127.0.0.1:33306/easyflow?useInformationSchema=true&characterEncoding=utf-8
username: root
password: root
hikari:
maximum-pool-size: 12
minimum-idle: 2
connection-timeout: 5000
validation-timeout: 3000
idle-timeout: 600000
max-lifetime: 1800000
flyway:
enabled: true
locations: classpath:db/migration/mysql
@@ -69,7 +76,7 @@ spring:
tablePrefix: TB_QRTZ_
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
threadPool:
threadCount: 20
threadCount: 8
threadPriority: 5
threads:
virtual:
@@ -104,6 +111,15 @@ easyflow:
consumer-block-timeout: 2000ms
pending-claim-idle: 60000ms
max-retry: 16
consumer-executor:
core-size: 4
max-size: 12
queue-capacity: 64
keep-alive-seconds: 60
pool:
max-active: 12
max-idle: 8
min-idle: 1
analytical-db:
# 是否启用分析数据库
enabled: true
@@ -148,6 +164,30 @@ easyflow:
root: /Users/slience/postgraduate/easyflow/attachment
# 后端接口地址,用于拼接完整 url
prefix: http://localhost:8111/attachment
ai:
rag:
health:
cache-ttl: 5s
document-import:
parse-monitor:
fixed-delay: 10000
initial-delay: 10000
batch-size: 10
thread-pool:
sse:
core-size: 4
max-size: 16
queue-capacity: 2000
keep-alive-seconds: 30
allow-core-thread-timeout: true
document-import:
core-size: 2
max-size: 4
queue-capacity: 200
keep-alive-seconds: 60
allow-core-thread-timeout: true
scheduler:
pool-size: 4
# xFileStorage存储文件配置
# 文档https://x-file-storage.xuyanwu.cn/
@@ -211,9 +251,9 @@ jetcache:
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
minIdle: 1
maxIdle: 12
maxTotal: 32
host: ${spring.data.redis.host}
port: ${spring.data.redis.port}
password: ${spring.data.redis.password}