What is Laravel Horizon and what are its advantages?

3 min read

Laravel Horizon is a package that includes a stunning dashboard for configuring your laravel Redis queues using code. Additionally, it gives you analytics, control, insight, and information on failed jobs, queue workers, and your job throughput.

Key Features

Here are key features of the Laravel Horizon

1.Auto Balancing of jobs

Using workers, Horizon helps manage queues. As a queue becomes overloaded, it recognises the employees automatically and moves the queues to them. Also, the Horizon offers a thorough interface for evaluating and rerunning the unsuccessful jobs.

2. Dashboard and metricsWhat is Laravel Horizon and what are its advantages?

With the help of the straightforward laravel/horizon composer, the Laravel website design comes with a single page, gorgeous dashboard that can be added right into the existing application. Additionally, it will offer real-time perceptiveness into recent jobs, unsuccessful jobs, queue workloads, run time data, and process counts. A straightforward callback using Horizon:: auth will manage dashboard authentication, giving you complete control over the dashboard.

In order to observe the run time trends for a specific job or for the entire queue, Horizon provides throughput and average run time charts. After a deployment, this metrics snapshot from the Horizon can help you immediately identify performance deteriorations.

3. Manage Queues

We can receive detailed statistics on all queues about jobs that have been finished during the last hour or last five minutes, as well as how long they took, with the aid of Laravel Horizon

Through the use of tags and logical grouping, Horizon makes it easy to handle all jobs. A single task may have numerous tags present at the same time. It gives task life cycle performance data reports to the project management. Reports for jobs that have been finished and the time they took can be made by task or task queue. Managers can check the framework's single general report to see the status of their current tasks.

4. Code-driven configurationWhat is Laravel Horizon and what are its advantages?

Because all of your queue worker configuration is contained in your code, Laravel queues can be set up using the Horizon simple code-driven configuration in a fashion that is similar to Laravel's schedule.

The source code control is provided by this code-driven configuration, which also makes it incredibly simple and straightforward for teams to collaborate. You may modify the queue processes, timeouts, and other settings in the config/horizon.php file, as well as how many processes you want to plan. Then, I only need a single, one line simple command - simple command to start all of my queue workers: php You can start with workers processes with the aid of artisan horizon, and you can also adjust your worker setup by redeploying the configuration file source.

5. Notifications

Horizon notifies users using a variety of channels, including Slack, SMS, mail, database, and broadcast notifications. Additionally, it alerts you when your queue is getting too full with jobs and works to increase queue capacity so that your application runs more efficiently. When a notification is delivered, more workers are needed to manage the tasks in your queue. You can increase the number of workers in the queue after receiving the message thanks to Horizon's code-driven configuration.

 

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Sofey Devine 2
Joined: 1 year ago
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up