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

(libev) select: Invalid argument when trying to go past 1k users #121

Closed
TTimo opened this issue Dec 27, 2013 · 7 comments
Closed

(libev) select: Invalid argument when trying to go past 1k users #121

TTimo opened this issue Dec 27, 2013 · 7 comments

Comments

@TTimo
Copy link

TTimo commented Dec 27, 2013

MacOS X 10.9, python 2.7 (macports)
Latest locust (github), latest pip packages

Testing a local setup, trying to break past 1000 users. I'm able to load up to 1000 users just fine (after bumping my ulimit), but locust crashes out past that point:

https://gist.github.com/TTimo/8149351

@cgbystrom
Copy link
Member

What version of gevent are you running? Could try upgrading to the latest version? 1.0 was released just a month ago.

@TTimo
Copy link
Author

TTimo commented Dec 30, 2013

gevent 1.0:

python2.7
Python 2.7.6 (default, Nov 18 2013, 15:12:51)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import gevent
gevent.version
'1.0'

libev from macports is 4.15:

sudo port search libev
libev @4.15 (devel)
asynchronous event library

that's also the latest released (http://dist.schmorp.de/libev/)

@Jahaja
Copy link
Member

Jahaja commented Jan 6, 2014

Sounds like it could be caused by the limit of 1024 file-descriptiors on select(2) on BSD (and thus osx). libev should probably use kqueue rather than select on OSX but I guess that the usage of libev on OSX isn't that common so it well may still be using select.

I couldn't reproduce it when I tried it briefly on my MBA. I'll dig into it further.

@TTimo
Copy link
Author

TTimo commented Jan 6, 2014

Could be a macports problem then, and a configuration issue with the
library. Maybe kqueue isn't selected by default for some reason.

On Sun, Jan 5, 2014 at 7:24 PM, Joakim Hamrén [email protected]:

Sounds like it could be caused by the limit of 1024 file-descriptiors on
select(2) on BSD (and thus osx). libev should probably use kqueue rather
than select on OSX but I guess that the usage of libev on OSX isn't that
common so it well may still be using select.

I couldn't reproduce it when I tried it briefly on my MBA. I'll dig into
it further.


Reply to this email directly or view it on GitHubhttps://github.com//issues/121#issuecomment-31621917
.

@justiniso
Copy link
Member

Can anyone confirm if this is still an issue? I'm not able to reproduce with my MBP: libev 4.22 (installed with brew, not macports though)

@mockshox
Copy link

mockshox commented Dec 2, 2017

I confirm this on macOS High Sierra with libev 4.24 (bottled).
Everything seems to work fine with 1000 users, however changing it to 1025 users results in:

[2017-12-02 12:19:09,562] iMac.local/ERROR/stderr: Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/locust/core.py", line 271, in run
    self.execute_next_task()
  File "/Library/Python/2.7/site-packages/locust/core.py", line 297, in execute_next_task
    self.execute_task(task["callable"], *task["args"], **task["kwargs"])
  File "/Library/Python/2.7/site-packages/locust/core.py", line 309, in execute_task
    task(self, *args, **kwargs)
  File "/Users/mikolaj/Desktop/hello/locust/locustfile.py", line 7, in index
    self.client.get("/")
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/Library/Python/2.7/site-packages/locust/clients.py", line 114, in request
    response = self._send_request_safe_mode(method, url, **kwargs)
  File "/Library/Python/2.7/site-packages/locust/clients.py", line 158, in _send_request_safe_mode
    return requests.Session.request(self, method, url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 583, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 248, in _get_conn
    if conn and is_connection_dropped(conn):
  File "/Library/Python/2.7/site-packages/requests/packages/urllib3/util/connection.py", line 34, in is_connection_dropped
    return select([sock], [], [], 0.0)[0]
  File "/Library/Python/2.7/site-packages/gevent/select.py", line 141, in select
    sel_results = _original_select(rlist, wlist, xlist, 0)
ValueError: filedescriptor out of range in select()

@cgoldberg
Copy link
Member

I confirm this on macOS High Sierra with libev 4.24 (bottled).

this is actually different than the original issue described. You are receiving a totally different stacktrace.

ValueError: filedescriptor out of range in select()

Have you increased file descriptors in your OS? If not, you need to.

This may be considered a bug in gevent, requests, or urllib3 for not handling the situation gracefully when you run out of file descriptors... but I don't see an actual Locust issue we can take action on besides aborting a test once you exhaust file descriptors.

I am closing this issue for now since there is nothing actionable to fix for Locust.

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

No branches or pull requests

6 participants