![]() ![]() In the example above, a maximum of one new process will be created or destroyed every three seconds. The balanceMaxShift and balanceCooldown configuration values to determine how quickly Horizon will scale to meet worker demand. When using the auto strategy, you may define the minProcesses and maxProcesses configuration options to control the minimum and maximum number of processes Horizon should scale up and down to: 'environments' => [ When the balance option is set to false, the default Laravel behavior will be used, which processes queues in the order they are listed in your configuration. For example, if your notifications queue has 1,000 waiting jobs while your render queue is empty, Horizon will allocate more workers to your notifications queue until it is empty. The auto strategy adjusts the number of worker processes per queue based on the current workload of the queue. ![]() ![]() The simple strategy, which is the configuration file's default, splits incoming jobs evenly between processes: 'balance' => 'simple', ![]() Horizon allows you to choose from three balancing strategies: simple, auto, and false. You should ensure that the environments portion of your horizon configuration file contains an entry for each environment on which you plan to run Horizon. This configuration file allows you to configure your worker options and each configuration option includes a description of its purpose, so be sure to thoroughly explore this file. You may use Composer to install Horizon into your Laravel project: composer require laravel/horizonĪfter installing Horizon, publish its assets using the horizon:install Artisan command: php artisan horizon:install ConfigurationĪfter publishing Horizon's assets, its primary configuration file will be located at config/horizon.php. You should ensure that your queue connection is set to redis in your queue configuration file. Horizon allows you to easily monitor key metrics of your queue system such as job throughput, runtime, and job failures.Īll of your worker configuration is stored in a single, simple configuration file, allowing your configuration to stay in source control where your entire team can collaborate. Horizon provides a beautiful dashboard and code-driven configuration for your Laravel powered Redis queues. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |