Skip to content

Conversation

@cuiweixie
Copy link
Contributor

@cuiweixie cuiweixie commented Dec 6, 2025

add flag

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

hmm, undecided about this

Comment on lines +218 to +220
if fdlimit == 0 {
// Use system default (raise to maximum)
match fdlimit::raise_fd_limit() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will alter current behaviour and will likely be super annoying

Copy link
Contributor Author

Choose a reason for hiding this comment

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

0 for old behavior may be okay.

Comment on lines +69 to +74
/// Raise the open file descriptor resource limit.
///
/// Default: 0 (system default). When set to 0, uses the system's default file descriptor
/// limit. When set to a positive value, attempts to raise the limit to that value.
#[arg(long, value_name = "LIMIT", default_value_t = 0, global = true)]
pub fdlimit: u64,
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure we really need this

imo always raising is appropriate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if the system allows setting a higher file descriptor limit, the actual availability of resources such as memory and CPU can impact the stability and performance of the program. Setting the file descriptor limit too high can lead to resource exhaustion, which may cause the system or application to become unstable. This is because every open file descriptor consumes system resources, and if the number of file descriptors is increased significantly, it can strain the system's capacity to manage them effectively. Therefore, it's important to consider the overall resource usage and system capabilities when adjusting file descriptor limits.

@cuiweixie
Copy link
Contributor Author

hmm, undecided about this

we might still need this for reason like debug and some other reason.

  1. Flexibility: It allows for easy adjustment if specific applications require a different limit than the maximum, either for performance tuning or resource management.

  2. Control: It provides explicit control over resource allocation, which can be important for debugging or optimizing application performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants