-
-
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
perf: reducing the lock strength of the soa cache entry #2285
Conversation
Utilize the singleflight package to ensure concurrent DNS SOA lookups are performed only once per unique request. This change improves efficiency by preventing multiple redundant lookups for the same fully qualified domain name (FQDN).
Hello,
Also:
The usage inside lego is neither case 1 (because the entry for a given is written several times) nor case 2 (because it's not a disjoint set of keys). I think there are no advantages. Additionally, with your changes, the Also, I need to understand why you are doing this PR:
|
Your commit is not the expected answer, I'm waiting for a comment (in English). Otherwise, are you an employee of @fit2cloud? |
Hello, The lines of code may not match, I have modified some of the handling of This is before modification, 200 concurrent. This is after the modification, 200 concurrent. Blocking changed from lock to udp, and each blocks its own udp request, so the result will be returned quickly, reducing the number of coroutines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Based on the information from this PR:
- 2 different users on the same PR
- 200 concurrent requests per second
I can be wrong, but I think there is a company behind this, and it's not a problem.
But, please consider asking your company to donate.
If there is no company behind this, please consider donating anyway.
This will be appreciated, thank you ❤️
muFqdnSoaCache.Lock() | ||
fqdnSoaCache = map[string]*soaCacheEntry{} | ||
muFqdnSoaCache.Unlock() | ||
fqdnSoaCache.Clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clear()
was added in Go 1.23, please update go.mod or use API compatible with Go 1.22. Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will not update to go1.23, but I will change this.
When a large number of applications are made, there will be a large number of lock seizures and lower performance