-
Notifications
You must be signed in to change notification settings - Fork 319
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
Thread manager instantiation in the validator #4603
Conversation
7dc07f7
to
ed1cb50
Compare
4722843
to
faace10
Compare
faace10
to
53f97fd
Compare
max_threads = 8 | ||
|
||
[rayon_configs.solRetransmit] # runs turbine protocol retransmit logic | ||
max_threads = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought current Agave set this to 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these are all from optimized config. I have pulled them all from the PR for now and will initially use current values (even though these are "better").
worker_threads = 4 | ||
|
||
[rayon_configs.solWinInsert] | ||
worker_threads = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one was set to 8 as well
|
||
[rayon_configs.solAccounts] # AccountsDb foreground threads | ||
worker_threads = 6 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra newline?
[tokio_configs.solQuicTpuFwd] | ||
worker_threads = 4 | ||
|
||
[tokio_configs.solRepairQuic] # this is not used on MNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these comments are getting orphaned for sure if/when we turn on QUIC for these protocols 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes:) But I will re add stuff to the file as I run integration and make sure they are all correct.
let active_cnt = runtime.running_count.load(Ordering::SeqCst); | ||
match active_cnt { | ||
0 => debug!("Shutting down Native thread pool {name}"), | ||
_ => warn!("Native pool {name} has active threads during shutdown!"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be useful for debug to include number of threads still active
impl ThreadManagerConfig { | ||
/// Returns a valid "built-in" configuration for Agave that is safe to use in most cases. | ||
/// Most operators will likely use this. | ||
pub fn default_for_agave() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we just make this the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No as "default" config should be effectively empty (as it is used by Deserialize). Since this functionessentially parses Toml it would create an infinite loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! Just one recommendation for readability/improving documentation
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
#[serde(default)] | ||
pub struct ThreadManagerConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would add just a quick comment here about what ThreadManager is, what it does, and why it's needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is already present in https://github.com/alexpyattaev/agave/blob/tm_validator/thread-manager/README.md I did not want to also pollute the code with detailed info that would duplicate the readme. As for the struct you're highlighting I figured ThreadManagerConfig is pretty self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hand up! I missed the REAME.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm!
Problem
Starting the integration of thread manager into agave. This PR is just to make sure thread manager can be instantiated at startup. Separate PRs will be made to add CLI arguments, and to actually patch it in where it is needed.
Summary of Changes