-
Notifications
You must be signed in to change notification settings - Fork 60
Description
We've already successfully implemented environment caching with EnvCache
to reduce database load, but for deployments with 20,000+ nodes, we need to extend this caching pattern to node operations. The QueryReadHandler
and other node-related handlers are experiencing performance issues due to frequent database queries for node data.
Currently, every request that needs node data calls h.Nodes.GetByKey()
directly, which results in:
- A database query for every incoming node request
- No reuse of frequently accessed node data
- High database load with thousands of concurrent node connections
This screenshot shows the total number of calls for each database query over the past three hours. As you can see, after applying the in-memory cache, the SELECT tls_env
query stopped increasing. Previously, it was the most frequently executed query.
You can find the implementation at: #636
We would like to implement the same thing for the node key.