Laravel Horizon

                                                                                        Horizon is an elegant dashboard and code driven configuration for Laravel powered Redis queues. It allows you to effortlessly monitor key metrics of your queue system like job throughput, runtime, job failure etc. It is a single page application built using vue. You can install it directly into your existing application using composer require command.

composer require laravel/horizon

Authentication to the dashboard is controlled by call-back which is registered through Horizon::auth. All of your queue worker configurations is in your code i.e. in a single file allowing the entire team to collaborate.

'environments' => [

    'production' =>[

        'supervisor-1'=> [

           'connection' => 'redis',

            'queue' => ['default'],

            'balance'=> 'auto',

           'minProcesses' => 1,

           'maxProcesses' => 10,

            'tries'=> 3,

        ],

    ],

],

Horizon allows you to configure duration of recent and failed jobs should be persisted, by default it is 1 hour and for failed jobs its one week.

'trim' => [

    'recent' => 60,

    'failed' =>10080,

],

These are commands you can pass to Horizon:

php artisan horizon:pause # pause but not stop worker

php artisan horizon:continue # resume after pause

php artisan horizon:terminate # gracefully stop during deploy process

php artisan horizon:snapshot # take a metrics snapshot; cron as often as you want.