-
Notifications
You must be signed in to change notification settings - Fork 1k
Monitor contention in tokio threadpool #917
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
Conversation
@@ -64,7 +63,6 @@ lazy_static! { | |||
git_testament!(TESTAMENT); | |||
|
|||
fn main() { | |||
println!("REORG_THRESHOLD = {:#?}", *REORG_THRESHOLD); |
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.
👍
node/src/main.rs
Outdated
); | ||
let contention_logger = logger.clone(); | ||
std::thread::spawn(move || loop { | ||
std::thread::sleep(Duration::from_secs(10)); |
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.
My gut is telling me that 10 seconds is too sparse, contention could come and go during that window.
This seems cheap enough to run every 10ms - 100ms. Is that the case?
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.
Agreed, I'll lower to 100ms.
ping_send.clone().send(pong_send).wait().unwrap(); | ||
let mut timeout = Duration::from_millis(1); | ||
while pong_receive.recv_timeout(timeout).is_err() { | ||
warn!(contention_logger, "Possible contention in tokio threadpool"; |
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.
If add a LogCode
here, that would help in making a Grafana panel + alert for this
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'll add a code, but we should probably alert on any warn
level log.
A simple mechanism that periodically checks the threadpool responsiveness. Part of the investigation for #856.