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 tokio to current thread #1639

Open
Firstyear opened this issue Sep 3, 2024 · 2 comments
Open

Limit tokio to current thread #1639

Firstyear opened this issue Sep 3, 2024 · 2 comments

Comments

@Firstyear
Copy link

Hi there,

In https://github.com/pendulum-project/ntpd-rs/blob/main/ntpd/bin/ntp-daemon.rs#L5 you are using tokio::main which activates the multi-thread scheduler. On my xeon server with 24 threads, this means that I have ntpd-rs with 24 idle threads.

I would assume that setting tokio to the current_thread runtime flavour would probably be okay for the project, and also seems like a simpler/less resource consuming default?

@SoftExpert
Copy link

Hi,

My 2 cents here: if the number of threads is important in the context of a highly solicited server, on simpler setups it is overkill; perhaps adding a config parameter / startup flag would be the best response for both situations ...

@Firstyear
Copy link
Author

I'd be fine with configurable too, but I would say the default should be single thread as the majority of users of this I assume will be clients. If you're running an ntpd-rs server then it's easy to bump this up if needed.

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

No branches or pull requests

2 participants