-
Notifications
You must be signed in to change notification settings - Fork 176
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
Initialize FD limits on MacOS and Linux platforms at startup #333
Conversation
…e DEFAULT and DESIRED limit constants.
… part of the kaspad_lib crate (this way if these values are changed, they will propagate downstream)
println!("Current OS file descriptor limit (soft FD limit) is set to {limit}"); | ||
println!("The kaspad node requires a setting of at least {DESIRED_DAEMON_SOFT_FD_LIMIT} to operate properly."); | ||
println!("Please increase the limits using the following command:"); | ||
println!("ulimit -n {DESIRED_DAEMON_SOFT_FD_LIMIT}"); |
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.
Is it worth making a recommendation in README.md so that this can be done intentionally before the user uses kaspad?
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.
Perhaps. I don't want to touch the readme right now because of another outstanding PR that needs a review. Now that we have discovered that this works I am much less concerned about this as it appears that rusty will now self-configure in most cases and will only fail to do this in some unusual circumstances, which I am currently not sure what they are... I think the upcoming T11 should show if there are any issues with any types of exotic hardware/setups.
…t#333) * Attempt to initialize OS FD limits during the kaspad startup sequence. * cleanup * Refactor to use setmaxstdio on windows, remove hard limit and increase DEFAULT and DESIRED limit constants. * relocate FD limit constants to daemon so that they are available as a part of the kaspad_lib crate (this way if these values are changed, they will propagate downstream) * rename fd_budget fn to try_set_fd_limit * fix typo (1024->4096) * change 4096 to 4*1024 * lints
MacOS allows applications to set FD limits. The same should work in Linux if you are running as a root.
This PR adds an initializer that passively attempts to configure the needed settings and warns the user if it cannot do so (the output needs to be
println!()
as the logging subsystem is not yet initialized.