Skip to content
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

Try to increase open files limit and warn if it is still too low afterwards #1375

Merged
merged 3 commits into from
May 22, 2020

Conversation

cyberw
Copy link
Collaborator

@cyberw cyberw commented May 15, 2020

Fixes #1368

@cyberw
Copy link
Collaborator Author

cyberw commented May 15, 2020

Note: the warning is the most important thing, trying to set it (which may only work on MacOS) is more of a convenience

@codecov
Copy link

codecov bot commented May 15, 2020

Codecov Report

Merging #1375 into master will decrease coverage by 0.16%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1375      +/-   ##
==========================================
- Coverage   81.48%   81.32%   -0.17%     
==========================================
  Files          26       26              
  Lines        2323     2329       +6     
  Branches      360      361       +1     
==========================================
+ Hits         1893     1894       +1     
- Misses        340      345       +5     
  Partials       90       90              
Impacted Files Coverage Δ
locust/main.py 19.51% <16.66%> (-0.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e10f4bd...49ce465. Read the comment docs.

@cyberw cyberw marked this pull request as draft May 15, 2020 15:45
…imum open files they allow a process to set, so reduce the target to what all allow
@cyberw cyberw marked this pull request as ready for review May 18, 2020 21:07
@cyberw cyberw merged commit 35cb1d9 into master May 22, 2020
# Increasing the limit to 10000 within a running process should work on at least MacOS.
# It does not work on all OS:es, but we should be no worse off for trying.
resource.setrlimit(resource.RLIMIT_NOFILE, [10000, resource.RLIM_INFINITY])
except:
Copy link
Member

Choose a reason for hiding this comment

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

bare except also catches KeyboardInterrupt and SystemExit.... change this to except Exception

@cyberw cyberw deleted the try-to-set-open-file-limit-and-warn-if-it-is-too-low branch March 22, 2022 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We should check limits (ulimit) and warn if they are too low
2 participants