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

filedescriptor out of range in select() #131

Closed
Alexei17 opened this issue Mar 3, 2024 · 3 comments
Closed

filedescriptor out of range in select() #131

Alexei17 opened this issue Mar 3, 2024 · 3 comments

Comments

@Alexei17
Copy link

Alexei17 commented Mar 3, 2024

Happens when you have lots of processes (I had about 150) that constantly restart connections. Happens because of the 1024 limit on FD_SETSIZE. More info here: https://stackoverflow.com/questions/14250751/how-to-increase-filedescriptors-range-in-python-select


Exception in thread amqpstorm.io:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/dist-packages/amqpstorm/io.py", line 259, in _process_incoming_data
    if self.poller.is_ready:
       ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/amqpstorm/io.py", line 45, in is_ready
    ready, _, _ = self.select.select([self.fileno], [], [],
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: filedescriptor out of range in select()
@Anderseta
Copy link

Anderseta commented Sep 23, 2024

This needs to be changed to poll() instead of select()
I am also facing this issue, did you find any workaround besides changing to PIKA ?

@eandersson
Copy link
Owner

This needs to be changed to poll() instead of select() I am also facing this issue, did you find any workaround besides changing to PIKA ?

I can look at implementing poll instead of select, but could you try to bump the open file limit on your system to see if that has any affect?
https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/

@Anderseta
Copy link

Anderseta commented Sep 24, 2024

This needs to be changed to poll() instead of select() I am also facing this issue, did you find any workaround besides changing to PIKA ?

I can look at implementing poll instead of select, but could you try to bump the open file limit on your system to see if that has any affect? https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/

Thank you for your answer, this changed nothing (i already had a very high custom open file limit), i am sure poll would fix this, but you should know that it does not work on windows (if i remember correctly).

In case anyone reads this in the future, I would like to point out that i changed it all to PIKA and i did not regret it, after you cross the "threadsafe" barrier of it, it is very very fast with less overhead than AMQPSTORM, it is literally a choice between performance and ease of programming, since i got a massive server running with rabbitmq, i had to choose PIKA.

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

No branches or pull requests

3 participants