feat: raise default sizes for non-evictable shared dicts#13688
Merged
nic-6443 merged 2 commits intoJul 10, 2026
Conversation
The prometheus-metrics, service-discovery, and tracing shared dicts reject writes and drop data when full, with no self-healing eviction. Their previous defaults overflow on medium and large deployments, causing silently missing metrics, unresolved upstream nodes, or lost trace spans that are hard to diagnose. Raise the defaults so a typical deployment works without manual tuning: - prometheus-metrics: 15m/10m -> 256m - kubernetes / consul discovery shared_size: 1m -> 64m - nacos / nacos-stream discovery: 10m -> 64m - tracing_buffer: 10m -> 32m An explicit size in config.yaml (or a discovery config's shared_size) always overrides the default, so deployments that already tune these are unaffected. Signed-off-by: Nic <qianyong@api7.ai>
moonming
previously approved these changes
Jul 10, 2026
AlinsRan
previously approved these changes
Jul 10, 2026
shreemaan-abhishek
previously approved these changes
Jul 10, 2026
128m covers typical Prometheus series counts while keeping reserved shared memory and the metrics endpoint response size reasonable; raise it for high-cardinality deployments. Signed-off-by: Nic <qianyong@api7.ai>
d242314
shreemaan-abhishek
approved these changes
Jul 10, 2026
membphis
approved these changes
Jul 10, 2026
AlinsRan
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
prometheus-metrics, service-discovery (kubernetes/consul/nacos), andtracing_buffershared dicts reject writes and drop data when full — unlike caches such asplugin-limit-countorbalancer-ewma, they have no self-healing eviction. Their current defaults overflow on medium and large deployments, producing symptoms that are hard to diagnose: silently missing Prometheus series, upstream nodes that never resolve, or lost trace spans.This raises the defaults so a typical deployment works without hand-tuning
lua_shared_dict/shared_size:prometheus-metricskubernetes/consulshared_sizenacos/nacos-streamtracing_bufferBackward compatible. An explicit size in
config.yaml(or a discovery config'sshared_size) always overrides the default, so deployments that already tune these are unaffected.Trade-off. These are larger reserved zones. On Linux the memory is committed lazily as a dict actually fills, so a small/idle deployment does not pay the full cost up front, and deployments that don't use a subsystem (discovery / tracing) can lower or omit the value. Feedback on the exact defaults is welcome — the intent is to pick values that cover the majority of deployments rather than the smallest possible footprint.
Checklist
shared_sizedefault, en + zh)nginx.confreflects the new defaults