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

We should check limits (ulimit) and warn if they are too low #1368

Closed
cyberw opened this issue May 8, 2020 · 2 comments · Fixed by #1375
Closed

We should check limits (ulimit) and warn if they are too low #1368

cyberw opened this issue May 8, 2020 · 2 comments · Fixed by #1375

Comments

@cyberw
Copy link
Collaborator

cyberw commented May 8, 2020

Occasionally people file tickets/SO issues that seem to relate to this:

#496

https://stackoverflow.com/questions/61633170/locust-error-nodename-nor-servname-provided-or-not-known/61651507?noredirect=1#comment109058148_61651507

We could add something like this:

if resource.getrlimit(resource.RLIMIT_NOFILE)[0] < 10000:
    logger.warning("System open file limit setting is not high enough for load testing. See https://docs.locust.io/en/stable/installation.html#increasing-maximum-number-of-open-files-limit for more info.")
@cyberw
Copy link
Collaborator Author

cyberw commented May 12, 2020

It appears you can actually change the NOFILE setting from inside the python process (at least it worked for me). Maybe that is even better. Or we could do both (try to set it really high, silently ignore if it fails, but warn if the limit after trying to set it is too low)

@heyman
Copy link
Member

heyman commented May 12, 2020

It appears you can actually change the NOFILE setting from inside the python process (at least it worked for me). Maybe that is even better. Or we could do both (try to set it really high, silently ignore if it fails, but warn if the limit after trying to set it is too low)

Interesting! Sounds like a good idea, though I'd like us to test this out on some different platforms (Windows/Linux/Mac) and running as non-admin, to make sure it would behave as expected.

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

Successfully merging a pull request may close this issue.

2 participants