More screenshots

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    Repair Background Job Starvation

    1

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

    $8.99

    Secure checkout via Stripe

    30-day refund 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.

    What you get

    Prevent high-volume tenants from saturating shared worker pools.Fix retry hot-loops that exhaust CPU and memory during service outages.Implement weighted fair queuing to meet internal and external SLAs.Debug race conditions in job state transitions and authority boundaries.

    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.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Passed all security checks, Safe to install

    Listed1 month ago

    What's inside

    Frequently Asked Questions