-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
[FIX] queue_job: runner - filedescriptor out of range in select #408
Conversation
May I ask you for a review here, please? |
340e774
to
9587c4e
Compare
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.
Looks good, thanks!
Out of curiosity, do you have a setup with more than 255 workers?
I'm curious about numbers now! 🤩
Hi @guewen Thanks for your review
Yes, we have a customer using monolith server and they need to support 5k concurrent website users purchasing After running stress testing we reach the focus using 300 workers But it can be even reproduced it locally: Forcing the current SelectSelector used by Odoo: Using the DefaultSelector: I know a better option is using horizontal autoscaling with small servers But even using a DefaultSelector has performance improves and it has a better evolution over different system over the time Thanks for asking |
Great! |
111810b
to
a1c49f6
Compare
Use the most efficient Selector implementation available on the current platform Odoo supports only SelectSelector but it is a little obsolete python >= 3.4 supports a new high-level library Selectors: - https://docs.python.org/es/3/library/selectors.html It could to auto-choose the following ones: - SelectSelector - PollSelector - EpollSelector - DevpollSelector - KqueueSelector Using the DefaultSelector class the most efficient implementation available on the current platform will be use: - https://docs.python.org/3/library/selectors.html#selectors.DefaultSelector It helps to support better the resources of the system Using SelectSelector you are not able to run workers >=255 If you set `ulimit -n 10240` and run `odoo-bin --workers=255` the following error is raised: Traceback (most recent call last): File "odoo/service/server.py", line 926, in run self.sleep() File "odoo/service/server.py", line 852, in sleep sel.select(self.beat) File "python3.8/lib/python3.8/selectors.py", line 323, in select r, w, _ = self._select(self._readers, self._writers, [], timeout) ValueError: filedescriptor out of range in select() But using PollSelector it is not reproduced even using more workers Most of platform supports PollSelector but using DefaultSelector we can be sure that even too old system are supported too And using this High-level library will allow to use the future new improvements e.g. Epoll has better performance improvements More info about: - https://devarea.com/linux-io-multiplexing-select-vs-poll-vs-epoll - redis/redis-py#486 - odoo/odoo#84684
a1c49f6
to
974d050
Compare
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.
LGTM
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
@moylop260 do you use this in production succesfully? Is it safe to merge? |
We have already released in production and it is working well However, if you are using workers>=255 Odoo itself will raise errors So, don't have sense to merge this PR if Odoo is not fixing it first The related PR is: Let me ask if they agree with the change or if it needs something else After merge it, I think we can use this way too here Thanks for follow-up |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Hi @guewen, |
/ocabot merge minor |
Hey, thanks for contributing! Proceeding to merge this for you. |
@gurneyalex The merge process could not be finalized, because command
|
Congratulations, your PR was merged at 5e6d44f. Thanks a lot for contributing to OCA. ❤️ |
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.
LGTM, merging
Use the most efficient Selector implementation available on the current platform
Odoo supports only SelectSelector but it is a little obsolete
python >= 3.4 supports a new high-level library Selectors:
It could to auto-choose the following ones:
Using the DefaultSelector class the most efficient implementation available on the current platform will be use:
It helps to support better the resources of the system
Using SelectSelector you are not able to run workers >=255
If you set
ulimit -n 10240
and runodoo-bin --workers=255
the following error is raised:
But using PollSelector it is not reproduced even using more workers
Most of platform supports PollSelector but using DefaultSelector we can be sure
that even too old system are supported too
And using this High-level library will allow to use the future new improvements
e.g. Epoll has better performance improvements
More info about: