Performance: Job priorities and queues
MEDIUM IMPACT
This affects how background jobs are processed, impacting response time and server load distribution.
class HardJob < ApplicationJob queue_as :hard def perform(*args) # long running task end end class SoftJob < ApplicationJob queue_as :soft def perform(*args) # quick task end end # Configure workers to prioritize 'soft' queue over 'hard' queue
class HardJob < ApplicationJob queue_as :default def perform(*args) # long running task end end class SoftJob < ApplicationJob queue_as :default def perform(*args) # quick task end end
| Pattern | Queue Usage | Job Processing Delay | Server Load Distribution | Verdict |
|---|---|---|---|---|
| Single default queue | One queue for all jobs | High delay for important jobs | Uneven, long tasks block others | [X] Bad |
| Multiple prioritized queues | Separate queues by priority | Low delay for high priority jobs | Balanced load, faster critical job processing | [OK] Good |