- Home
- Skills
- Agents & Orchestration
- Repair Background Job Starvation
More screenshots
Works with the AI Agents you already use
Repair Background Job Starvation
Diagnose and repair background-job fairness, priority starvation, tenant concurrency, retry priority, and scheduler pressure.
$1
Repair Background Job Starvation
Example session with this skill installed
Our Sidekiq cluster is being overwhelmed by a single client's bulk imports, causing 10-minute delays for transactional emails. Review the current queue config and suggest a fairness fix.
- Read your context and instructions
- Compiled the repair background job
I have analyzed the current queue configuration. The root cause is a lack of concurrency limits on the imports queue, which allows a single tenant to saturate the default worker pool.
Sidekiq Fairness Implementation
The following implementation introduces a sidekiq-limit_fetch approach to ensure transactional emails (critical) are not starved by bulk imports.
# config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
# Define strict limits for the imports queue to prevent starvation
config.caps = {
'imports' => 5 # Maximum 5 concurrent import jobs across the cluster
}
# Ensure the critical queue is always checked first,
# but high-volume queues are weighted to prevent total starvation
config.queues = [
['critical', 10],
['default', 5],
['imports', 1]
]
end
# lib/workers/bulk_import_worker.rb
class BulkImportWorker
include Sidekiq::Worker
# Apply a client-side limit to ensure no single tenant takes more than 2 slots
sidekiq_options queue: :imports, lock: :until_executed,
lock_args: ->(args) { args.first } # client_id
def perform(client_id, data_url)
# Job logic here
end
end
Deterministic Test Plan
To verify this invariant without waiting for real jobs:
1.
Concurrency Test: Use Sidekiq::Testing.fake! to enqueue 20 jobs for client_A and 5 for client_B. Verify that the scheduler only permits the defined cap for the imports queue.
2.
Priority Test: Enqueue 100 imports followed by 1 critical. Verify the critical job is popped within the next 2 worker cycles regardless of the import backlog.
Next steps
- Install the
sidekiq-limit_fetchgem to enable thecapsfunctionality. - Update the
BulkImportWorkerto include theclient_idas the primary lock argument. - Monitor the
sidekiq_queue_latency_secondsmetric specifically for thecriticalqueue.
Connects securely to your tools. The creator never sees your data.
About this skill
Repair Background Job Starvation targets production and repository defects around diagnose and repair background-job fairness, priority starvation, tenant concurrency, retry priority, and scheduler pressure.. It examines priority queue selection rules, tenant/workload concurrency caps, retry priority and hot-loop behavior, aging or fairness mechanism already supported, worker reservation and prefetch, long-job versus short-job competition, backlog and latency observability, safe rollout under mixed workers, then establishes one explicit repair contract and focused deterministic validation.
The skill works from repository access or partial evidence such as snippets, logs, configuration, traces, and architecture notes. It preserves existing product/security policy, avoids invented execution claims, and keeps production systems, real credentials, and deployment outside the validation path.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Requires repository access or detailed configuration snippets to be effective. Does not perform live infrastructure scaling or cloud resource provisioning.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago