More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Repair Background Job Starvation

    1

    Diagnose and repair background-job fairness, priority starvation, tenant concurrency, retry priority, and scheduler pressure.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Repair Background Job Starvation

    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_fetch gem to enable the caps functionality.
    • Update the BulkImportWorker to include the client_id as the primary lock argument.
    • Monitor the sidekiq_queue_latency_seconds metric specifically for the critical queue.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Permissions

    Terminal / Shell
    Listed2 months ago
    Updated8 days ago

    What's inside

    Frequently Asked Questions

    This skill identifies bottlenecks where high-volume tenants or low-priority retries 'starve' critical tasks, providing a concrete repair plan to balance concurrency, aging mechanisms, and scheduler pressure.

    The skill supports common distributed task frameworks like Sidekiq and Celery, and is compatible with any AI agent that has repository access or can ingest log and configuration snippets.

    No, the skill operates on repository code, configuration files, and architectural notes, ensuring your live production environment and credentials remain untouched during the diagnosis and validation phase.

    You receive the diagnostic logic for identifying starvation patterns, a specific repair contract for your workload, and a suite of deterministic validation steps to verify the fix before deployment.

    The skill handles complex scenarios including long-job vs. short-job competition, worker prefetch settings, and ensuring safe rollouts across environments with mixed worker versions.

    New in Agents & Orchestration