Skip to content

Implement Node Caching to Improve Performance with Large Deployments #637

@zhuoyuan-liu

Description

@zhuoyuan-liu

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:

  1. A database query for every incoming node request
  2. No reuse of frequently accessed node data
  3. 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.

Image

You can find the implementation at: #636

We would like to implement the same thing for the node key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions