Introduction
The Laravel queue is one of the most popular features of the framework, and Laravel Cloud makes it simple to start queue workers to process jobs that are dispatched by your application for background processing.Queue processing options
Laravel Cloud offers three approaches for processing queued jobs:- Queue Clusters - Production ready queue processing with intelligent auto-scaling
- Worker Clusters - Dedicated clusters for custom worker processes and scheduled tasks
- App Cluster Background Processes - Best for development and low-volume processing
Feature | Queue Clusters | Worker Clusters | App Cluster Background Processes |
---|---|---|---|
Queue Isolation | Fully dedicated to specific queues | Shared with other background processes | Shared with background processes and web traffic |
Auto-scaling | Intelligent scaling based on job latency | CPU/RAM based scaling | CPU/RAM based scaling |
Queue clusters (recommended)
Best for: High-volume processing with intelligent scaling Queue clusters runphp artisan queue:work
in a fully isolated cluster whose sole purpose is running and intelligently scaling queue worker processes. Queue clusters do not compete with your application’s web traffic or other scheduled tasks for resources.
Learn more about queue clusters
Worker clusters
Best for: Medium-volume processing separated from web traffic Worker clusters provide a middle ground where you can runphp artisan queue:work
in a cluster separated from web traffic, but worker clusters can also manage additional scheduled tasks and custom background processes that compete for cluster compute. Worker clusters scale based on CPU/RAM rather than queue depth and latency.
Learn more about creating worker clusters
App cluster background processes
Best for: Development and low-volume processing Allow you to runphp artisan queue:work
in an all-in-one cluster alongside your web application. Cost-effective but queues compete with web traffic for resources.
Queue clusters (developer preview)
Queue clusters are currently in developer preview. Features and pricing may change as we gather feedback from customers.
Key benefits
- Intelligent Scaling: Automatic scaling based on job latency and queue depth
- Dedicated Infrastructure: Completely isolated from your application’s web traffic
- Fully Managed: No manual configuration of worker processes or scaling rules required
When to use queue clusters
Queue clusters are ideal for:- Production Applications: High-volume job processing with reliability requirements
- Priority Job Separation: Isolating critical jobs from general application traffic
- Variable Workloads: Applications with unpredictable queue volumes that benefit from auto-scaling
Creating a queue cluster
To create a new queue cluster, navigate to your environment’s infrastructure canvas and click “New queue cluster”. Configure your compute resources and queue settings based on your application’s requirements. The queue cluster will automatically scale the number of worker processes based on job latency and queue depth to ensure jobs are processed immediately. For pricing information, see the compute section of our pricing page.Creating queue workers on worker clusters
Instead of processing your application’s queued jobs on the App compute instance that also handles your application’s incoming HTTP traffic, you may add queue workers to dedicated Worker clusters. Processing queued jobs on Worker clusters allows you to scale those clusters independently of the App cluster which handles your web traffic. To add queue workers to a dedicated Worker cluster, you should first create the Worker cluster. Then, click on the Worker compute cluster within the infrastructure canvas dashboard. Then, within the “Background processes” section of your cluster settings, click “New background process”. Next, configure your queue worker options based on your environment’s requirements and select the number ofqueue:work
processes within the given configuration that you would like to create. Finally, save and deploy your environment changes to start your queue worker.
Custom processes, including queue workers, will be spawned for each instance of your application or worker cluster, depending on your autoscaling configuration.For example, given an application that scales to 5 replicas, a
queue:work
process configured with 10 processes
, would create 50 processes total. Smaller compute instances may consume excess memory through these additional workers, potentially creating unnecessary replica scaling.Creating queue workers on app clusters
The simplest way to begin processing queued jobs is to add a queue worker background process to your environment’s App compute cluster. When running queue workers on your App compute cluster, queued jobs will be processed on the same compute instances that handle your application’s incoming HTTP traffic. To get started, click on your environment’s App compute cluster within the infrastructure canvas dashboard. Then, within the “Background processes” section of your cluster settings, click “New background process”.
queue:work
processes within the given configuration that you would like to create. Finally, save and deploy your environment changes to start your queue worker.

When running queue workers via Laravel Cloud, there is no need to run the
queue:restart
Artisan command after each deployment.Custom background processes
In addition to configuringqueue:work
processes, Laravel Cloud also allows you to configure arbitrary long-lived custom background processes, such as Laravel Horizon.
To get started, click on a compute cluster within your environment’s infrastructure canvas dashboard. Then, within the “Background processes” section of your cluster settings, click “New background process”.
Next, click the “Custom worker” tab and provide your custom worker command and the number of instances of the command that should be started. For instance, for Laravel Horizon, you should provide the php artisan horizon
command and specify that Laravel Cloud should create 1
process.
