feat: optimize nacos discovery with privileged agent and LRU cache#12867
feat: optimize nacos discovery with privileged agent and LRU cache#128679268 wants to merge 10 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes Nacos service discovery by moving registry fetch work to the privileged agent process and introducing a version-controlled per-worker LRU cache to reduce repeated JSON decoding.
Changes:
- Restrict Nacos registry fetching timers to the privileged agent process only.
- Add a per-worker LRU cache for decoded node lists keyed by a shared-dict “version”.
- Store and manage per-service
#versionentries in thenacosshared dict to drive cache invalidation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @9268, please fix failed CI |
|
@Baoyuantop hi,ci has been fixed https://github.com/9268/apisix/actions/runs/21792352299 |
|
a code lint issue has been fixed; |
|
@Baoyuantop |
Description
This PR fixes a performance issue introduced by #12353 where all worker processes were fetching nacos service discovery information, causing unnecessary network requests and JSON parsing overhead per requests.
Changes made:
Performance improvements:
Which issue(s) this PR fixes:
Fixes #12353
Checklist