Skip to content

Commit

Permalink
Describe pessimistic usecases (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
shouichi authored Aug 15, 2022
1 parent 04dc720 commit 12c8070
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ GoodJob's concurrency control strategy for `perform_limit` is "optimistic retry
- "Optimistic" meaning that the implementation's performance trade-off assumes that collisions are atypical (e.g. two users enqueue the same job at the same time) rather than regular (e.g. the system enqueues thousands of colliding jobs at the same time). Depending on your concurrency requirements, you may also want to manage concurrency through the number of GoodJob threads and processes that are performing a given queue.
- "Retry with an incremental backoff" means that when `perform_limit` is exceeded, the job will raise a `GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError` which is caught by a `retry_on` handler which re-schedules the job to execute in the near future with an incremental backoff.
- First-in-first-out job execution order is not preserved when a job is retried with incremental back-off.
- For pessimistic usecases that collisions are expected, use number of threads/processes (e.g., `good_job --queue "serial:1;-serial:5"`) to control concurrency. It is also a good idea to use `perform_limit` as backstop.
### Cron-style repeating/recurring jobs
Expand Down

0 comments on commit 12c8070

Please sign in to comment.