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

Add option to disable synchronization on creation for auto refresh cache #5940

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Sovietaced
Copy link
Contributor

@Sovietaced Sovietaced commented Oct 30, 2024

Why are the changes needed?

We have an interesting usage pattern of the auto refresh cache.

  • New items can be added to the cache up to 1k QPS.
  • Items are synchronized in batches of 500 items.
  • Items are synchronized once every second.

When items are synchronized in single item batches upon creation it disrupts our batch synchronization strategy and puts a lot of load on the server where task state is being read from. You could tune the rate limiter but it will also affect both single item batch and regular batch synchronization. So the solution we found was to add this option which just doesn't try to add a single item batch when items are created in the cache.

What changes were proposed in this pull request?

Adds an option to the auto refresh cache SyncOnCreate which defaults to true for backwards compatibility.

How was this patch tested?

We run this in production but I also added unit tests.

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Built on top of #5813

Signed-off-by: Jason Parraga <[email protected]>
Signed-off-by: Jason Parraga <[email protected]>
Signed-off-by: Jason Parraga <[email protected]>
@Sovietaced Sovietaced marked this pull request as ready for review October 30, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant