Skip to content
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: lock optimizations for put speed #4207

Merged
merged 5 commits into from
Jul 6, 2023
Merged

Conversation

aloknerurkar
Copy link
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Bunch of fixes from perf testing on private clusters.

// if we have parallel sync workers for the same bin, we need to rate limit them
// in order to not overload the storage with unnecessary requests as there is
// a chance that the same chunk is being synced by multiple workers.
s.binLock.Lock(fmt.Sprint(bin))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key := strconv.Itoa(int(bin))
s.binLock.Lock(key)
defer s.binLock.Unlock(key)

@aloknerurkar aloknerurkar merged commit 6fb07f3 into master Jul 6, 2023
13 checks passed
@aloknerurkar aloknerurkar deleted the lockoptmizations branch July 6, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants