In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
What is Laravel Horizon and what is the role, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Laravel Horizon
Today I proudly announce Laravel Horizon, which provides an elegant dashboard and code-driven configuration system for Laravel Redis queues.
In addition to the new code-driven configuration system, Horizon also has a beautiful dashboard UI, which is completely open source and free for the entire Laravel community. We will release a test version tomorrow. I hope you will like it.
Instrument panel
Horizon Dashboard is a beautiful single-page Vue application that can be installed directly into existing applications through simple composer require laravel / horizon. It provides real-time insight into queue workloads, recent jobs, failed jobs, job retries, throughput and runtime metrics, and process counts. Authentication of the dashboard is controlled through a simple callback registered by Horizon:: auth, which gives you complete control over access to the dashboard.
Configuration
Horizon is an excellent new way to configure Laravel queues. Similar to Laravel's scheduler, all queue workers can be configured through code:
Having this configuration in your code means it's all under source control, making it easy for your team to collaborate. In the config/horizon.php file, we configure the number of processes to be created, the queues to be processed, the queue timeout, and any other settings that need to be passed to the queue:work Artisan command.
Then, to start all the queue workers, you only need a simple command: php artisan horizon. No additional command line options are required. This command reads the Horizon configuration and configures all necessary worker processes.
After Horizon is installed and deployed to a production environment, you can modify the configuration of the entire queue worker by modifying the configuration file and redeploying.
A failed task
Horizon provides a clear and detailed interface for checking and retrying failed tasks (yes, we all have). You can view the exception stack trace, tags, and recent retry records for the task. It's great to display the details of the failed task directly on the page. Because retry is linked to the failed original task, you no longer need to blindly try to enter queue:retry on the console and determine whether the retry completes successfully or fails again:
Label monitoring
Horizon allows you to assign tags to tasks, including Email, Broadcasts, Notifications, and Queued Listeners. In fact, Horizon intelligently tags most tasks based on the Eloquent Model attached to the queue.
You can easily search for queue tasks through these tags to view specific customer tasks or other queue tasks in the program. This feature allows you to quickly focus on high-value customers or find failed tasks for customers who have just submitted support orders:
Balanced cdn.xitu.io/2019/10/19/16de3d8afd832122?w=1240&h=388&f=png&s=61724 ">
Horizon can automatically balance the queue workers in the queue based on the workload of the queue. For example, if the default queue is empty but the notifications queue is full of queue tasks, Horizon can automatically assign notifications's tasks to the default queue to help with those tasks quickly.
After the queue catches up, Horizon ensures that tasks are redistributed fairly among all queues.
Index chart
Horizon provides throughput and average elapsed time charts, allowing you to view throughput and elapsed time trends for a single task or an entire queue. These metrics snapshots are taken using the horizon:snapshot command and can be set to run every minute using Laravel's built-in task scheduling. This allows you to quickly detect performance degradation after deployment.
Notice
When one of your queues reaches a certain load, Horizon sends both Slack and SMS notifications. You can easily configure wait time thresholds to determine when notifications are sent. This means that you always know when the queue needs more processing. After receiving the notification, Horizon's code-driven configuration allows you to quickly make configuration changes to add more processing processes.
I would like to give special thanks to Mohamed Said,David Hemphill and Steve Schoger, both of which have contributed to the design and development of Horizon. Steve designed the user interface, David Hemphill implemented the interface as a Vue application, and Mohamed connected the front end to the Horizon back end that I implemented.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.