event4u-app/agent-config

laravel-horizon

Use when working with Laravel queues in production — Horizon dashboard, worker supervision, job metrics, balancing strategies — even when the user just says 'my jobs are piling up'.

96Collecting
See how to use itView GitHub source
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/laravel-horizon"

Quick start

Start using it in three steps

Install it or open the source, trigger it with a clear task, then follow the source workflow.

1

Install the Skill

npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/laravel-horizon"
2

Describe the task

Use laravel-horizon to help me with: [describe your task]. Before you begin, tell me what input you need, the steps you will follow, and the expected output.

3

Follow the workflow

No structured workflow was detected; follow the original SKILL.md below.

Continue to the workflow

Direct answers

Answers to review before you install

What is laravel-horizon?

Use when working with Laravel queues in production — Horizon dashboard, worker supervision, job metrics, balancing strategies — even when the user just says 'my jobs are piling up'.

Who should use laravel-horizon?

It is relevant to workflows involving Deployment, Engineering.

How do you install laravel-horizon?

SkillSignal detected this source-specific command: npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/laravel-horizon". Inspect the repository and command before running it.

Which Agent platforms does it support?

The upstream source does not declare a dedicated Agent platform.

What permissions or risks should you review?

No obvious permission action was detected by the static rules. This is not proof that the Skill is safe.

What are the current evidence limits?

This page combines upstream documentation with deterministic repository, quality, and static-risk signals. It is not described as a manual test or security review.

SkillSignal brief

Decide whether it fits your work first

Use when working with Laravel queues in production — Horizon dashboard, worker supervision, job metrics, balancing strategies — even when the user just says 'my jobs are piling up'.

Useful in these contexts

Not yet included in a workflow collection

Core capabilities

DeploymentEngineering

Distilled from the source

Understand this Skill in one minute

About 2 min · 13 sections

When it is worth using

  1. Queue worker configuration and supervision

  2. Horizon dashboard setup and access control

  3. Job metrics, throughput, and failure monitoring

  4. Balancing strategies and scaling workers

Examples and typical usage

  1. Updated Horizon configuration with supervisor and queue settings

  2. Environment-specific balancing strategy rationale

Repository stars
7
Repository forks
1
Quality
96/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

96/100
Documentation28/30
Specificity23/25
Maintenance20/20
Trust signals25/25
View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 2 min

laravel-horizon

When to use

Use this skill for anything related to Laravel Horizon:

  • Queue worker configuration and supervision
  • Horizon dashboard setup and access control
  • Job metrics, throughput, and failure monitoring
  • Balancing strategies and scaling workers
  • Production tuning and deployment

For writing queue jobs themselves, see jobs-events.

Procedure: Configure Horizon

  1. Inspect current queue setup — Read config/queue.php, config/horizon.php (if present), and composer.json to identify the current driver, supervisors, and queues in use.
  2. Pick environments and balance strategy — Decide per-env maxProcesses, balance, tries, timeout based on workload; review the config block below.
  3. Apply configuration — Edit config/horizon.php, register supervisors and queue priority.
  4. Verify — Run php artisan horizon locally, hit /horizon dashboard, confirm jobs flow and metrics appear.

config/horizon.php

'environments' => [
    'production' => [
        'supervisor-1' => [
            'maxProcesses' => 10,
            'balanceMaxShift' => 1,
            'balanceCooldown' => 3,
            'connection' => 'redis',
            'queue' => ['default', 'high', 'low'],
            'balance' => 'auto',  // auto, simple, or false
            'tries' => 3,
            'timeout' => 60,
            'maxTime' => 3600,
            'maxJobs' => 1000,
            'memory' => 128,
        ],
    ],
    'local' => [
        'supervisor-1' => [
            'maxProcesses' => 3,
            'connection' => 'redis',
            'queue' => ['default', 'high', 'low'],
            'balance' => 'auto',
            'tries' => 3,
            'timeout' => 60,
        ],
    ],
],

Queue priority

// Higher priority queues are listed first
'queue' => ['high', 'default', 'low'],

Running Horizon

# Start Horizon (foreground)
php artisan horizon

# Pause / Continue
php artisan horizon:pause
php artisan horizon:continue

# Terminate gracefully (for deployments)
php artisan horizon:terminate

# Check status
php artisan horizon:status

Deployment

Always terminate and restart Horizon after deploying new code:

php artisan horizon:terminate
# Supervisor will auto-restart Horizon

Supervisor config (production)

[program:horizon]
process_name=%(program_name)s
command=php /path/to/artisan horizon
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/var/log/horizon.log
stopwaitsecs=3600

Dashboard access

// HorizonServiceProvider
protected function gate(): void
{
    Gate::define('viewHorizon', function (User $user): bool {
        return $user->isSuperuser();
    });
}

Balancing strategies

StrategyBehavior
autoDistributes workers based on queue workload (recommended)
simpleRound-robin across queues
falseFixed worker count per queue

Metrics and monitoring

  • Throughput — jobs processed per minute per queue
  • Runtime — average job execution time
  • Wait time — time jobs spend waiting in queue
  • Failed jobs — track and retry from dashboard
  • Tags — auto-tagged by Eloquent models, custom tags via tags() method
// Custom tags on a job
public function tags(): array
{
    return ['customer:' . $this->customer->getId(), 'report'];
}

Core rules

  • Always use Supervisor in production — Horizon is a long-running process.
  • Terminate on deployhorizon:terminate ensures workers pick up new code.
  • Use auto balancing — it adapts to workload automatically.
  • Set maxTime — prevents workers from running forever (memory leaks).
  • Set maxJobs — recycles workers after N jobs to prevent memory bloat.
  • Tag jobs — makes debugging and filtering in the dashboard much easier.

Output format

  1. Updated Horizon configuration with supervisor and queue settings
  2. Environment-specific balancing strategy rationale

Auto-trigger keywords

  • Horizon
  • queue worker
  • queue dashboard
  • job monitoring
  • supervisor
  • queue balancing

Gotcha

  • Horizon config changes require php artisan horizon:terminate and restart — they don't hot-reload.
  • Don't set maxProcesses too high — each process holds a DB connection. Monitor your connection pool.
  • The model forgets that Horizon only works with Redis queues — not database or SQS.

Do NOT

  • Do NOT run Horizon without Supervisor/systemd in production.
  • Do NOT expose the Horizon dashboard without access control.
Skill path
src/skills/laravel-horizon/SKILL.md
Commit SHA
0adf49a8ae84
Repository license
MIT
Data collected