Skip to content

improve(prometheus): merge prometheus caches#11719

Open
JinzhouChen-xmu wants to merge 1 commit into
mainfrom
merge_caches
Open

improve(prometheus): merge prometheus caches#11719
JinzhouChen-xmu wants to merge 1 commit into
mainfrom
merge_caches

Conversation

@JinzhouChen-xmu
Copy link
Copy Markdown
Contributor

@JinzhouChen-xmu JinzhouChen-xmu commented May 11, 2026

优化的成果(1000w条kv,实际数据300M value和label):

  • 整体常驻内存占用进一步减少20%(encoder缓存的kv和label)
  • 内存峰值进一步减少(少了encoder缓存更新,以及tagrecoder临时获取kv缓存)
  • cpu使用率整体下降
    实际数据
8049ad72-5c51-4d42-a630-359742dfba01 优化后常驻内存详情(encoder和tagrecoder缓存部分优化掉) 优化后静态

This PR is for:

Server

@JinzhouChen-xmu JinzhouChen-xmu changed the title merge caches improve(prometheus): merge prometheus caches May 12, 2026
@JinzhouChen-xmu JinzhouChen-xmu removed the request for review from Ericsssss May 12, 2026 09:43
}
return

if !wait && c.refreshInterval > 0 && !c.lastRefresh.IsZero() && time.Since(c.lastRefresh) < c.refreshInterval {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上次优化将 refreshInterval 默认值由 60s 改成 300s 了,cache 变成公用层在没有增量更新的情况下,应该需要改回 60s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants