-
Notifications
You must be signed in to change notification settings - Fork 817
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
feat(loadbalance): do not cache all the keys for Consistent Hash #1370
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DMwangnima
force-pushed
the
fix/remove_chash_cache
branch
4 times, most recently
from
June 4, 2024 13:36
3373097
to
c8fc23e
Compare
DMwangnima
changed the title
feat: do not cache all the keys for Consistent Hash by default
feat: do not cache all the keys for Consistent Hash
Jun 4, 2024
DMwangnima
changed the title
feat: do not cache all the keys for Consistent Hash
feat(loadbalance): do not cache all the keys for Consistent Hash
Jun 4, 2024
DMwangnima
force-pushed
the
fix/remove_chash_cache
branch
3 times, most recently
from
June 5, 2024 06:12
b482ee1
to
dd75508
Compare
YangruiEmma
previously approved these changes
Jun 5, 2024
DMwangnima
force-pushed
the
fix/remove_chash_cache
branch
3 times, most recently
from
June 5, 2024 07:12
cd16086
to
f3286bc
Compare
Key CharacteristicRandom Key with length of 30. func getRandomString(length int) string {
var resBuilder strings.Builder
resBuilder.Grow(length)
corpus := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
rand.Seed(time.Now().UnixNano() + int64(100))
for i := 0; i < length; i++ {
resBuilder.WriteByte(corpus[rand.Intn(len(corpus))])
}
return resBuilder.String()
} Benchmark Result:
|
DMwangnima
force-pushed
the
fix/remove_chash_cache
branch
from
June 7, 2024 10:12
3e00d3a
to
1f0e1bb
Compare
YangruiEmma
approved these changes
Jun 7, 2024
ppzqh
approved these changes
Jun 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
feat
Check the PR title.
(Optional) Translate the PR title into Chinese.
feat: 对于一致性哈希,不缓存所有的键
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
Consistent hashing caches all the Keys, which in a scenario where the Keys are very fragmented, may cause a constant increase in memory and increase the overhead of managing the cache, thus affecting performance.
zh(optional):
一致性哈希会缓存所有的 Key, 在 Key 非常分散的场景下,可能会造成内存的持续升高以及增大管理缓存的开销,进而影响性能
(Optional) Which issue(s) this PR fixes:
(optional) The PR that updates user documentation: