-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from ckb-cell/feature/increase-fd-soft-limit
feat: try increasing file descriptor soft limit for service at start
- Loading branch information
Showing
7 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
//! Utilities. | ||
mod key; | ||
mod platform; | ||
mod type_id; | ||
pub(crate) mod value_parsers; | ||
|
||
pub(crate) use key::Key256Bits; | ||
pub(crate) use platform::try_raise_fd_limit; | ||
pub(crate) use type_id::calculate_type_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//! Enhance the platform environment for continuously running services. | ||
use fdlimit::{raise_fd_limit, Outcome}; | ||
|
||
pub fn try_raise_fd_limit() { | ||
match raise_fd_limit() { | ||
Ok(Outcome::LimitRaised { from, to }) => { | ||
log::info!("raise file descriptor resource limit from {from} to {to}"); | ||
} | ||
Ok(Outcome::Unsupported) => { | ||
log::warn!("raising limit is not supported on this platform"); | ||
} | ||
Err(err) => { | ||
log::error!("failed to raise file descriptor resource limit, since {err}"); | ||
} | ||
} | ||
} |