-
Notifications
You must be signed in to change notification settings - Fork 762
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(query): get the system open file limits and set #8388
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
850fd44
to
1983e4f
Compare
@mergify update |
❌ Base branch update has failedrefusing to allow a GitHub App to create or update workflow |
1983e4f
to
8ed1d16
Compare
I have pushed a demo FYI: |
8ed1d16
to
745242e
Compare
updated |
df40ecd
to
95d902e
Compare
@BohuTANG It seems that limits-rs can't work on MacOS. |
@mergify update |
❌ Base branch update has failedrefusing to allow a GitHub App to create or update workflow |
95d902e
to
9a20a4e
Compare
We can add:
to check. |
9a20a4e
to
58a65e1
Compare
I wouldn't say I like this PR. It's not a good idea to set open file limits in code. How about printing a warning message with the action needs to take? For example: The open file limit is too low for the databend-query. Please consider increase it by running `ulimit -n 65536` There are many system settings that need to tune for query, we can't set them all. |
That's right! |
OK,I will print a warning message instead of set open file limits in this PR. |
@TszKitLo40 Thanks for your work! This PR is almost LGTM now. I left some review here, PTAL. |
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.
Thanks for your contribution!
05668dc
to
d618911
Compare
CI failure need to be addressed: error[E0425]: cannot find value `e` in this scope
--> src/binaries/query/main.rs:265:64
|
265 | warn!("get system limit of databend-query failed: {e:?}");
| ^ not found in this scope |
d618911
to
df1903a
Compare
I think I have fixed it. |
Please merge with the |
df1903a
to
5ed1855
Compare
@@ -34,7 +34,9 @@ use databend_query::servers::MySQLHandler; | |||
use databend_query::servers::Server; | |||
use databend_query::servers::ShutdownHandle; | |||
use databend_query::GlobalServices; | |||
use limits_rs::get_own_limits; |
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.
Remove the use.
use tracing::info; | ||
use tracing::warn; |
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.
Remove the use.
let max_open_files_limit = limits.max_open_files.soft; | ||
if let Some(max_open_files) = max_open_files_limit { | ||
if max_open_files < 65535 { | ||
warn!( |
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.
warn! --> tracing::warn!
This PR breaks the MacOS:
|
|
||
#[cfg(not(target_os = "macos"))] | ||
fn check_max_open_files() { | ||
let limits = match get_own_limits() { |
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.
get_own_limits-->limits_rs::get_own_limits
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.
Do I need to file another PR to fix this problems?
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.
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
If the open file limit is less than 65535, set it to 65535.
Fixes #8387