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

feat: track the pool's queued vs actually active tasks #1605

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

pjenvey
Copy link
Member

@pjenvey pjenvey commented Sep 30, 2024

and consider idle threads as a "max" value as the underlying tokio threadpool will exit threads idle for too long

Closes SYNC-4424

@pjenvey pjenvey requested review from jrconlin and taddes September 30, 2024 19:53
let blocking_threadpool = Arc::new(BlockingThreadpool::default());
let blocking_threadpool = Arc::new(BlockingThreadpool::new(
settings.worker_max_blocking_threads,
));
let db_pool = DbPoolImpl::new(
&settings.syncstorage,
&Metrics::from(&metrics),
blocking_threadpool.clone(),
)?;
let worker_thread_count =
calculate_worker_max_blocking_threads(settings.worker_max_blocking_threads);
Copy link
Member Author

@pjenvey pjenvey Sep 30, 2024

Choose a reason for hiding this comment

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

In retrospect I don't know why we included worker_ in this setting's name because it's the overall number of threads (not per worker). Whereas the naming of the calculate_worker_max_blocking_threads fn makes sense. I might change it.

@pjenvey pjenvey force-pushed the feat/threadpool-queued-metrics-SYNC-4424 branch from cd1803f to 3440a52 Compare September 30, 2024 22:01
and consider idle threads as a "max" value as the underlying tokio threadpool
will exit threads idle for too long

Closes SYNC-4424
@pjenvey pjenvey force-pushed the feat/threadpool-queued-metrics-SYNC-4424 branch from 3440a52 to f921d8e Compare September 30, 2024 22:15
@pjenvey pjenvey merged commit 1f0e28d into master Sep 30, 2024
8 checks passed
@pjenvey pjenvey deleted the feat/threadpool-queued-metrics-SYNC-4424 branch September 30, 2024 23:13
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.

2 participants