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

Runs accounts delta hash calculation in thread pool #3389

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Oct 30, 2024

Problem

In Bank::freeze() we calculate the accounts delta hash for the slot. This is in the critical path, so we do the delta hash calc in parallel. Since an explicit thread pool is not specified, the delta hash calc ends up running in the global thread pool. This may not be ideal, if other tasks are running in the global pool (or get added later).

There is already a thread pool for foreground tasks, so we should use that one here.

h/t to @steviez for bringing this up

Summary of Changes

Run the accounts delta hash calc in the accounts-db foreground thread pool.

Results

Here's metrics from mce3 and mce4 before and after picking up this change:
(Note, mce3 restarted twice, which is why it has two spikes. mce4 only restarted once, hence one spike.)

Screenshot 2024-10-31 at 9 28 15 AM

Comparing pre and post, we see the accounts delta hash time got faster for both machines by quite a noticeable amount! ~1 ms for mce3 and ~0.5 ms for mce4.

@brooksprumo brooksprumo added the v2.1 Backport to v2.1 branch label Oct 30, 2024
@brooksprumo brooksprumo self-assigned this Oct 30, 2024
Copy link

mergify bot commented Oct 30, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for grabbing this one!

@brooksprumo brooksprumo marked this pull request as ready for review October 30, 2024 14:05
Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm

@brooksprumo
Copy link
Author

Merging this one so it is ready for the backport meeting 😸

@brooksprumo brooksprumo merged commit ffd261e into anza-xyz:master Oct 30, 2024
41 checks passed
@brooksprumo brooksprumo deleted the delta-hash-thread-pool branch October 30, 2024 15:32
mergify bot pushed a commit that referenced this pull request Oct 30, 2024
Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm.

brooksprumo added a commit that referenced this pull request Oct 31, 2024
…#3389) (#3391)

Runs accounts delta hash calculation in thread pool (#3389)

(cherry picked from commit ffd261e)

Co-authored-by: Brooks <[email protected]>
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.1 Backport to v2.1 branch
Projects
Development

Successfully merging this pull request may close these issues.

4 participants