-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add ulimit too small prompt #5078
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
Conversation
Signed-off-by: rao yunkun <yunkunrao@gmail.com>
apisix/cli/ops.lua
Outdated
| end | ||
|
|
||
| if env.ulimit <= 1024 then | ||
| print(str_format("Warning! Current user limits [%d] too small, please modify user limits by execute \'ulimt -n <new user limits>\' , otherwise the performance is low.", env.ulimit)) |
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.
| print(str_format("Warning! Current user limits [%d] too small, please modify user limits by execute \'ulimt -n <new user limits>\' , otherwise the performance is low.", env.ulimit)) | |
| print(str_format("Warning! Current user limits [%d] is too small, please modify user limits by execute \'ulimt -n <new user limits>\' , otherwise the performance is low.", env.ulimit)) |
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.
Got it.
apisix/cli/env.lua
Outdated
|
|
||
| return function (apisix_home, pkg_cpath_org, pkg_path_org) | ||
| -- ulimit setting should be checked when APISIX starts | ||
| ulimit = tonumber(util.trim(util.execute_cmd("ulimit -n"))) |
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.
Should check the nil, err returned from execute_cmd, and log the err
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.
Got it
apisix/cli/ops.lua
Outdated
| end | ||
|
|
||
| if env.ulimit <= 1024 then | ||
| print(str_format("Warning! Current user limits [%d] is too small, please modify user limits by execute \'ulimt -n <new user limits>\' , otherwise the performance is low.", env.ulimit)) |
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.
Better to mention what kind of the 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.
Got it
Signed-off-by: rao yunkun <yunkunrao@gmail.com>
spacewander
left a comment
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.
Need to fix the lint: https://github.com/apache/apisix/runs/3638128084
Signed-off-by: rao yunkun <yunkunrao@gmail.com>
Signed-off-by: rao yunkun <yunkunrao@gmail.com>
nic-chen
left a comment
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.
should be better add a test case
Signed-off-by: rao yunkun yunkunrao@gmail.com
What this PR does / why we need it:
This PR is related with #2467
Pre-submission checklist: