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
feat(workers): many small RQ worker features #18995
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
add-test-cases
Add test case to validate fix or enhancement
label
Nov 24, 2022
ankush
force-pushed
the
multi_queue_workers
branch
from
November 24, 2022 08:24
5d927b3
to
1d0ad6b
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #18995 +/- ##
===========================================
- Coverage 63.46% 63.39% -0.08%
===========================================
Files 750 750
Lines 67621 67733 +112
Branches 6027 6027
===========================================
+ Hits 42917 42939 +22
- Misses 21230 21320 +90
Partials 3474 3474
Flags with carried forward coverage won't be shown. Click here to find out more. |
ankush
force-pushed
the
multi_queue_workers
branch
from
November 24, 2022 10:57
1d0ad6b
to
40caa3f
Compare
ankush
changed the title
feat(workers): allow consuming multiple queues
feat(workers): many small RQ worker features
Nov 24, 2022
ankush
force-pushed
the
multi_queue_workers
branch
2 times, most recently
from
November 24, 2022 11:07
c24619c
to
7ebc046
Compare
ankush
requested review from
phot0n
and removed request for
shariquerik and
surajshetty3416
November 24, 2022 12:19
ankush
added
docs-pending
Feature was merged without docs for some reason
docs-required
and removed
docs-pending
Feature was merged without docs for some reason
labels
Nov 24, 2022
phot0n
reviewed
Nov 24, 2022
Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
ankush
force-pushed
the
multi_queue_workers
branch
from
November 25, 2022 06:44
cf1abe4
to
ed28626
Compare
ankush
added
the
defer backport
Backports for some PR are deferred for a week or two to test them properly before releasing
label
Nov 25, 2022
sagarvora
reviewed
Nov 25, 2022
ankush
added
backport version-14-hotfix
backport to version 14
and removed
docs-required
defer backport
Backports for some PR are deferred for a week or two to test them properly before releasing
labels
Nov 25, 2022
ankush
added a commit
that referenced
this pull request
Nov 30, 2022
* fix: prioritize short queue when using all queues (cherry picked from commit b7cef3a) * feat(workers): allow consuming multiple queues (cherry picked from commit 40b2929) * refactor: consider multi-queue consumption (cherry picked from commit 0ebd394) * feat: burst mode in workers https://python-rq.org/docs/workers/#burst-mode (cherry picked from commit aece93f) # Conflicts: # frappe/commands/scheduler.py # frappe/core/doctype/rq_job/test_rq_job.py * feat: support dequeuing strategies for worker (cherry picked from commit a8bf86e) # Conflicts: # frappe/commands/scheduler.py * refactor: simpler deque strat selection Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> (cherry picked from commit ed28626) * chore: conflicts Co-authored-by: Ankush Menat <ankush@frappe.io> Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
frappe-pr-bot
pushed a commit
that referenced
this pull request
Dec 6, 2022
# [14.18.0](v14.17.1...v14.18.0) (2022-12-06) ### Bug Fixes * attribute error on export of reports with additional columns ([#19105](#19105)) ([2b43d5b](2b43d5b)) * check for bad zip files during unzipping in file doctype ([#19058](#19058)) ([#19060](#19060)) ([96c928e](96c928e)) * **db_query:** Disallow usage of certain functions in *_by ([#18981](#18981)) ([#19135](#19135)) ([5376755](5376755)) * **db_query:** Space resilient sanitization (backport [#18996](#18996)) ([#19045](#19045)) ([ab8422f](ab8422f)) * disable signups by default (backport [#19114](#19114)) ([#19118](#19118)) ([3dd2775](3dd2775)) * do not escape undefined txt ([86267e9](86267e9)) * empty search shows `None` ([#19055](#19055)) ([#19057](#19057)) ([1cd0bc2](1cd0bc2)) * ensure correct parenttype when retrieving roles ([af55da9](af55da9)) * give more weight to sequential matches ([#19121](#19121)) ([#19122](#19122)) ([16f642f](16f642f)) * ignore empty/`None` scripts ([#19111](#19111)) ([#19113](#19113)) ([2a96757](2a96757)) * keep actions on right ([7d3e47b](7d3e47b)) * LDAP - check each email in list before creating user ([250f787](250f787)) * only check for special characters in fieldname ([#19061](#19061)) ([#19065](#19065)) ([de0facc](de0facc)), closes [#18965](#18965) * only System Manager can access Google Drive ([05be9ee](05be9ee)) * Optimize check field type is tab break if the doctype has a workflow ([#18858](#18858)) ([d9ce6c1](d9ce6c1)) * site creation using non-root users ([#19014](#19014)) ([#19043](#19043)) ([844e744](844e744)) * socketio spawn error ([#19070](#19070)) ([#19071](#19071)) ([75a54eb](75a54eb)) * type conversion for read receipt in communication email ([e0f7dd4](e0f7dd4)) * use permtype from passed arguments in has_web_form_permission when applying document permissions ([91c99d2](91c99d2)) * use webform doctype rather than allowing user to pass any doctype ([2be3178](2be3178)) * **UX:** freeze on delete ([#19094](#19094)) ([dd4791a](dd4791a)) * **UX:** Make fetch_from read_only if fetch_is_empty is not set ([#19025](#19025)) ([#19041](#19041)) ([feed227](feed227)) * Widget control on dashboard chart breaks on smaller screens ([d6dedca](d6dedca)) ### Features * **workers:** many small RQ worker features (backport [#18995](#18995)) ([#19046](#19046)) ([37dbada](37dbada))
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
reference for all of this: https://python-rq.org/docs/workers/
Multi-queue consumption
Why?
If you drop
--queue
argument altogether then all queues are consumed. So both of these are equievalent if you dont have custom queues.Note: RQ has inbuilt prioritization, the order of specified queues matters. So in the example above until the short queue is finished default queue won't be worked upon and so on.
burst mode
If you only periodically need higher worker count you can do so by calling
bench worker --burst
this can be useful in high workload scenario.Worker exits once specified queues are cleared.
Dequeue strategies
bench worker --strategy round_robin
will give equal priority to all specified queues.random
does it randomly. Default strategy (no flags required) gives priority based on order you specify.docs: https://frappeframework.com/docs/v14/user/en/api/background_jobs