Skip to content

Instantly share code, notes, and snippets.

@martin-ro
Last active May 24, 2025 07:23
Show Gist options
  • Save martin-ro/4dcffb8538e0a0e1be47205a999c8c07 to your computer and use it in GitHub Desktop.
Save martin-ro/4dcffb8538e0a0e1be47205a999c8c07 to your computer and use it in GitHub Desktop.
horizon.php
<?php
use Illuminate\Support\Str;
return [
'domain' => env('HORIZON_DOMAIN'),
'path' => env('HORIZON_PATH', 'horizon'),
'use' => 'default',
'prefix' => env(
'HORIZON_PREFIX',
Str::slug(env('APP_NAME', 'laravel'), '_').'_horizon:'
),
'middleware' => ['web'],
'waits' => [
'redis:default' => 60,
],
'trim' => [
'recent' => 10,
'pending' => 10,
'completed' => 10,
'recent_failed' => 1440,
'failed' => 1440,
'monitored' => 60,
],
'silenced' => [
// App\Jobs\ExampleJob::class,
],
'metrics' => [
'trim_snapshots' => [
'job' => 24,
'queue' => 24,
],
],
'fast_termination' => false,
'memory_limit' => 128,
'environments' => [
'production' => [
'supervisor-default' => [
'connection' => env('QUEUE_CONNECTION'),
'queue' => [
env('APP_ENV').'-default',
env('APP_ENV').'-scout',
env('APP_ENV').'-update',
env('APP_ENV').'-import',
],
'balance' => 'auto',
'autoScalingStrategy' => 'time',
'balanceMaxShift' => 1,
'balanceCooldown' => 3,
'maxProcesses' => 1,
'maxTime' => 3600,
'maxJobs' => 1000,
'memory' => 512,
'tries' => 2,
'timeout' => 60,
'nice' => 10,
'rest' => 3,
],
'supervisor-scout' => [
'connection' => env('QUEUE_CONNECTION'),
'queue' => [
env('APP_ENV').'-scout',
env('APP_ENV').'-update',
env('APP_ENV').'-import',
env('APP_ENV').'-default',
],
'balance' => 'auto',
'autoScalingStrategy' => 'time',
'balanceMaxShift' => 1,
'balanceCooldown' => 3,
'maxProcesses' => 8,
'maxTime' => 3600,
'maxJobs' => 1000,
'memory' => 512,
'tries' => 2,
'timeout' => 60,
'nice' => 10,
'rest' => 3,
],
'supervisor-import' => [
'connection' => env('QUEUE_CONNECTION'),
'queue' => [
env('APP_ENV').'-import',
env('APP_ENV').'-update',
env('APP_ENV').'-scout',
env('APP_ENV').'-default',
],
'balance' => 'auto',
'autoScalingStrategy' => 'time',
'balanceMaxShift' => 1,
'balanceCooldown' => 3,
'maxProcesses' => 8,
'maxTime' => 3600,
'maxJobs' => 1000,
'memory' => 512,
'tries' => 2,
'timeout' => 60,
'nice' => 10,
'rest' => 3,
],
'supervisor-update' => [
'connection' => env('QUEUE_CONNECTION'),
'queue' => [
env('APP_ENV').'-update',
env('APP_ENV').'-import',
env('APP_ENV').'-scout',
env('APP_ENV').'-default',
],
'balance' => 'auto',
'autoScalingStrategy' => 'time',
'balanceMaxShift' => 1,
'balanceCooldown' => 3,
'maxProcesses' => 8,
'maxTime' => 3600,
'maxJobs' => 1000,
'memory' => 512,
'tries' => 2,
'timeout' => 60,
'nice' => 10,
'rest' => 3,
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment