Comments (4)
Yes totally makes sense, as it works in most cases as well - not always easy but almost always works.
Unfortunately as I'm doing live recordings the job has to run as long as the recording. It's some kind of background job but doesn't fit this most common definition of it - it fits more a daemon or supervisor process... but it's scheduled as well π
from delayed.
Hi @AxelTheGerman!
So, yes, you've hit on something that I think is expected behavior, which is that when a worker picks up a set of jobs, it will wait until the last job in that batch completes before it attempts to pick up any additional jobs. As a result, if you have long-running jobs and need higher worker availability, you must run multiple workers at once.
A recommendation for improving queue health in general is to break long-running jobs down into shorter-running jobs (delayed
is optimized for handling a huge volume of relatively short jobs, not a low volume of long-running jobs), but if that's not possible, then in addition to adding workers, you could consider having dedicated queues for particular scheduled tasks. It's also worth double checking your Delayed::Worker.max_run_time
to make sure that things aren't timing out.
from delayed.
Hi @smudge thank you for the in depth answer... just wondering if that's worth documenting somewhere - but maybe it's edge case enough that this issue is enough documentation.
Most job frameworks seem to be optimized for a high volume of shorter jobs - I guess it's the easier problem to solve and (in most cases) write your code accordingly.
For now delayed
still works good enough for me, though I'll keep my eyes open for a tool actually built for longer running jobs (making sure they didn't die, surviving re-deploys etc.)
Great tip on having multiple queues and workers per queue... would be a shame to have some important smaller jobs wait behind hour long ones :P
from delayed.
Hi Axel, a common perspective in modern infrastructure and service design is to keep units of work small so that they can be resumed and retried quickly in the event of infra failure or network partition. Delayed is designed for short jobs because of that quality rather than because itβs easier per se; though I admit itβs also easier. It sort of mirrors the invention and subsequent adoption of RAID arrays instead of expensive highly reliable disk drives.
We have techniques for breaking down big batches of work into small jobs that reliably complete in aggregate which I think we may look into open sourcing in the future.
from delayed.
Related Issues (20)
- Dashboard UI HOT 4
- Configuring Exception Notification on Failure HOT 4
- cron, separate gem or pull request? HOT 3
- Running against a secondary database HOT 10
- How does delayed compare to good_job? HOT 7
- how many simultaneous workers can we run? HOT 2
- Periodic (Cron) jobs HOT 8
- Open to PRs? HOT 10
- Error while reserving job(s): PG::SyntaxError: ERROR: syntax error at or near "SKIP" HOT 5
- how to monitor worker processes HOT 2
- Clarification on idempotency requirement HOT 8
- Difference in error behavior when a job is undefined HOT 4
- Changes in schema usage/assumptions from `delayed_job`? HOT 2
- Consider adding jitter to retry interval
- Handling duplicate jobs HOT 4
- Job failed to load: undefined class/module Delayed::JobWrapper. HOT 2
- Locks not being cleared on SIGKILL HOT 2
- Support raise_signal_exceptions HOT 5
- Possible unthrottled spinloop when jobs fail to deserailize HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed.