mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
perf(usage): 优化 admin usage records 查询性能
- count 查询按需 JOIN,避免不必要的表关联 - 前端 onMounted 将 stats/heatmap/records/users 全部并行加载 - 调整缓存 TTL(聚合 30s->60s,列表 10s->15s) - 为 request_candidates 添加复合索引优化 fallback/retry 查询
This commit is contained in:
@@ -29,8 +29,8 @@ class CacheTTL:
|
||||
DASHBOARD_DAILY = 600 # 10分钟(每日统计)
|
||||
|
||||
# Admin usage pages (heavy DB aggregations / list queries)
|
||||
ADMIN_USAGE_AGGREGATION = 30 # 30秒
|
||||
ADMIN_USAGE_RECORDS = 10 # 10秒(列表页短缓存,避免轮询/重复刷新打爆 DB)
|
||||
ADMIN_USAGE_AGGREGATION = 60 # 60秒(聚合统计变化不频繁,适当延长减少 DB 压力)
|
||||
ADMIN_USAGE_RECORDS = 15 # 15秒(列表页短缓存,活跃请求通过轮询接口实时更新)
|
||||
|
||||
# Admin leaderboard (heavier, slower moving)
|
||||
ADMIN_LEADERBOARD = 300 # 5分钟
|
||||
|
||||
Reference in New Issue
Block a user