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

pilorama: merge in-queue batches #2231

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Feb 2, 2023

To achieve high performance we must choose proper values for both batch size and delay. For user operations we want to set low delay. However it would prevent tree synchronization operations to form big enough batches. For these operations, batching gives the most benefit not only in terms of on-CPU execution cost, but also by speeding up transaction persist (fsync).
In this commit we try merging batches that are already triggered, but not yet started to execute. This way we can still query batches for execution after the provided delay while also allowing multiple formed batches to execute faster.

Hardware performance tests show ~10x improvement for small objects put in one bucket.

Signed-off-by: Evgenii Stratonikov e.stratonikov@yadro.com

@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Merging #2231 (8a93857) into support/v0.35 (a27ef86) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 8a93857 differs from pull request most recent head 0fb666e. Consider uploading reports for the commit 0fb666e to get more accurate results

@@              Coverage Diff               @@
##           support/v0.35    #2231   +/-   ##
==============================================
  Coverage          30.87%   30.88%           
==============================================
  Files                383      383           
  Lines              28389    28393    +4     
==============================================
+ Hits                8766     8770    +4     
  Misses             18876    18876           
  Partials             747      747           
Impacted Files Coverage Δ
pkg/local_object_storage/pilorama/batch.go 90.90% <100.00%> (+0.90%) ⬆️
pkg/local_object_storage/pilorama/boltdb.go 79.92% <100.00%> (+0.07%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

acid-ant
acid-ant previously approved these changes Feb 2, 2023
Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

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

Commit msg not formated; deserves a CHANGELOG record.

To achieve high performance we must choose proper values for both
batch size and delay. For user operations we want to set low delay.
However it would prevent tree synchronization operations to form big
enough batches. For these operations, batching gives the most benefit
not only in terms of on-CPU execution cost, but also by speeding up
transaction persist (`fsync`).
In this commit we try merging batches that are already
_triggered_, but not yet _started to execute_. This way we can still
query batches for execution after the provided delay while also allowing
multiple formed batches to execute faster.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
@roman-khimov
Copy link
Member

Hardware performance tests show ~10x improvement for small objects put in one bucket.

What are the numbers in ops/s?

@fyrchik
Copy link
Contributor Author

fyrchik commented Feb 2, 2023

I don't have exact numbers saved (but @anatoly-bogatyrev can help here).

@fyrchik fyrchik merged commit b6c6317 into nspcc-dev:support/v0.35 Feb 2, 2023
@carpawell
Copy link
Member

Wrong PR number in commit msg 😬.

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.

4 participants