Cache getMapResponseData #409

Closed
opened 2025-12-29 01:28:31 +01:00 by adam · 0 comments
Owner

Originally created by @QZAiXH on GitHub (Jan 17, 2023).

I found in the process of optimizing cpu that the code in getMapResponseData goes to query the database several times, the node increases the database pressure increases, and the cpu also increases linearly.

Can we cache the results of mapRequest and getMapResponseData. When the API is called, first determine whether the mapRequest has changed, and if it has not changed, determine whether there is a getMapResponseData value in the cache, and if so, return it directly, and if not, get it again.

There are several cases to delete the getMapResponseData value.

  1. Namespace new machines.
  2. ALC has changed.

I am currently trying to optimize the code based on this idea, is there anything else I don't have in mind?

Originally created by @QZAiXH on GitHub (Jan 17, 2023). I found in the process of optimizing cpu that the code in getMapResponseData goes to query the database several times, the node increases the database pressure increases, and the cpu also increases linearly. Can we cache the results of mapRequest and getMapResponseData. When the API is called, first determine whether the mapRequest has changed, and if it has not changed, determine whether there is a getMapResponseData value in the cache, and if so, return it directly, and if not, get it again. There are several cases to delete the getMapResponseData value. 1. Namespace new machines. 2. ALC has changed. I am currently trying to optimize the code based on this idea, is there anything else I don't have in mind?
adam added the enhancement label 2025-12-29 01:28:31 +01:00
adam closed this issue 2025-12-29 01:28:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#409