-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] <title>Is it necessary to incorporate a local caching mechanism into the instance creation process? #2898
Comments
+1 connection local caching mechanism is already use in ssh db and soon. suggest we use |
This is a very good idea,@doveLin0818 Can you complete it? If you can, I will assign it to you. @doveLin0818 You can refer to Line 74 in 4236c43
|
@zhangshenghang hi,please assign to me |
BTW, another point. We can find that a new |
Hi tom , I will try to optimize this. |
Question
Recently, I fixed an issue related to instance reuse; for more details, please refer to #2886. To quickly address the online bug, my solution was somewhat crude. Below is the modified code, which prevents instance reuse problems caused by IP switching.
However, if a user or organization needs to monitor multiple Kafka instances, the current logic becomes ineffective, as it continuously creates new Kafka instances, potentially leading to performance degradation. Similarly, the existing code for RocketMQ repeatedly creates instances without enabling reuse. If an enterprise monitors multiple instances and requires high real-time performance with short monitoring refresh intervals, the repeated creation of instances becomes a significant concern.
Therefore, I am considering whether it is necessary to introduce a local caching mechanism (such as using Caffeine). The key could be a combination of app+ip+host, and the value would be the corresponding instance. Additionally, setting a relatively small cache size to prevent memory overflow and implementing an LRU eviction policy—which aligns well with our monitoring scenarios—would effectively allow the reuse of created instance objects, and we can start by implementing this for the Kafka client first and subsequently enable a gradual rollout.
If the community agrees that this solution is viable, please assign it to me, and I am willing to implement it.
The text was updated successfully, but these errors were encountered: