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

Limit parallel script processing thread pool to 4 by default #1764

Merged
merged 5 commits into from
Feb 21, 2023

Conversation

prasannavl
Copy link
Member

/kind chore

  • Limits parallel execution threads of Bitcoin threads to 4 by default.
  • We do not utilise this for DeFi TXs (unfortunately), and usually is just a wasted threads sitting around unless there are many many pure UTXO TXs. 4 threads should be sufficient for most practical purposes.
  • Doing this cleanup as a precursor to add a common worker pool for most other thread related activites

Bushstar
Bushstar previously approved these changes Feb 16, 2023
@Bushstar
Copy link
Member

Perhaps it is better to set DEFAULT_SCRIPTCHECK_THREADS to 4?

Then users can still override and set to 0 to let the client use GetNumCores(). This change will always cap the number of cores to 4 regardless of user settings.

@prasannavl
Copy link
Member Author

prasannavl commented Feb 20, 2023

Good catch. Switching to use DEFAULT_SCRIPTCHECK_THREADS

@prasannavl
Copy link
Member Author

Overlooked earlier - users can already override. This only changes the behaviour of the auto (0) config. Rest follow the same. Cannot change script default, since that's the one that will have a behaviour change across different hardware and also requires turning it into a non-const.

@prasannavl
Copy link
Member Author

Ignores the additional reverted commits - initial is the most optimal version, I believe.

@prasannavl prasannavl changed the title Defaults: Limit script threads to 4 by default Limit parallel script processing thread pool to 4 by default Feb 20, 2023
@prasannavl prasannavl merged commit fac10f3 into master Feb 21, 2023
@prasannavl prasannavl deleted the pvl/par-default branch February 21, 2023 03:21
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.

3 participants