[0:00] Are you ready to take your Q management [0:02] to the next level? Let's explore Level [0:05] Horizon, a powerful tool that provides a [0:07] beautiful dashboard and code-driven [0:09] configuration for managing your Rady's [0:11] cues. With Horizon, you can easily [0:13] monitor key metrics of your Q system, [0:16] such as job throughput, runtime, job [0:18] failures, and so on. This means you can [0:21] keep your application running smoothly [0:23] and efficiently while gaining valuable [0:25] insights into your background jobs. [0:28] Horizon acts as a central hub for all [0:30] your Q monitoring [music] needs. It [0:31] allows you to configure your workers in [0:33] a single manageable configuration file, [0:36] making it easy to scale and modify your [0:38] co-workers as needed. Let's take a look [0:41] together. Once you have Horizon [0:43] installed, you can access the dashboard [0:46] by going to / Horizon application. And [0:48] this is what it looks by looks like by [0:50] default. We don't have any data yet. And [0:53] we can see that it's currently inactive. [0:55] So let's change this. Now let's start [0:57] Horizon and push some jobs to the queue. [1:00] And we can do this by running PHP [1:03] artisan horizon. Here we go. And you can [1:05] also see I have my Q worker for the [1:07] default queue already running. So when [1:10] we go back to the dashboard, we can now [1:12] see it's active. We also see some more [1:14] information here about the queue about [1:16] supervisors. And we're going to talk [1:18] about this just in a bit. But let's push [1:21] some chops here so that we actually see [1:24] something. And in our application which [1:25] is called user lift, we're going to [1:27] import some users. And then we're going [1:29] to take a look again. And you can see [1:31] suddenly something is happening here. We [1:33] have 100 and one chops. Here we see jobs [1:36] per minute. We see currently it's just [1:38] running one process. And we can see here [1:41] on the left the pending jobs. It seems [1:44] like everything was already running. And [1:46] here are our completed jobs which we [1:49] used in order to import all the users to [1:52] our import users table. This already [1:54] went pretty well, but we can speed [1:56] things up a little bit while tweaking [1:58] our Horizon config file. Now, let's [2:00] increase the number of max processes [2:02] here for our local supervisor here, [2:05] which we're using. Then, we're going to [2:07] need to rerun Horizon and rerun our [2:10] Qwork. And then back here now, we're [2:13] going to import, let's say, 1,000 users [2:15] here. And if we go to the dashboard, [2:17] let's see what's happening now here. [2:19] Okay, we can already see that there are [2:20] one around 1,000 chops here being added [2:23] to our default queue. And we can see [2:25] it's already using all the three [2:27] processes. And you can also see that [2:29] chops per minute is now way faster than [2:31] it was before. So this means more [2:33] processes of course means that you can [2:35] handle more chops at the same time. And [2:38] I think we're already done here. Let's [2:40] see. Now we still have some pending jobs [2:42] here. The completed ones. You could also [2:44] see failed ones, but we don't have any [2:46] of them here. But it looks like it's [2:48] still running here. But it's going [2:49] pretty fast here as you can see. And I [2:51] think we should be already done in a [2:53] couple of seconds. 80 more jobs here. [2:57] Here we go. Pending jobs. No, we're done [3:00] now. And yeah, this was of course now [3:02] very fast now while running while using [3:04] three processes. And you can see it has [3:06] has gone down again to one process again [3:09] because that's the only thing we [3:10] currently need because there are no [3:11] chops on our default queue. [3:14] It is important to mention that you have [3:16] to find the right settings, amount of [3:17] processing, retries or timeouts for your [3:20] own situation. There is a lot you can [3:22] tweak to your exact needs. But I want to [3:24] show you here one more thing. Okay, back [3:27] here in the config file for our local [3:29] supervisor, we have defined the default [3:31] queue, a male ske, and the backups Q. [3:34] And we have given them 10 processes to [3:37] share. And now again, let's import let's [3:40] say 1,000 users again. Let's start this [3:43] and let's go back here. We can already [3:45] see we have 1,000 chops here, but we [3:47] also see the other cues here, backups on [3:48] meals. We have no chops here at all. And [3:51] you can see it's already using a little [3:53] more processes than before, now it's [3:54] using um five processes. And our [3:57] supervisor is currently using already [4:00] eight. So this means from those 10 [4:01] processes which we have allocated for [4:03] the supervisor one now most of them are [4:06] being used by default Q because they [4:08] already see that there are no shops [4:10] being processed on backups and mails and [4:12] this is called autobalancing. So that it [4:15] use all the possible processes for the [4:18] [snorts] queue which has the most chops [4:21] and you can see it's already done by [4:22] processing around 1,000 chops per [4:25] minute. And now the processes went back [4:27] to just one because yeah, Horizon sees [4:30] there that there are zero jobs for all [4:32] the other cues. So only three processes [4:34] are currently being used for our [4:37] supervisor. [4:39] In summary, Laval Horizon is essential [4:41] tool for any Laval developer looking to [4:43] manage their cues effectively. It [4:45] enhances your application background job [4:47] processing capabilities and provides [4:50] valuable insights into your job [4:51] performance. For more details and [4:53] advanced uses, be sure to check out the [4:56] official docs. As always, happy coding [4:58] and enjoy managing your cues with [5:01] Larable Horizon.