Manage Laravel queue workers
In this guide, we will create a site queue worker definition, prepare its service, and verify background job processing.
In this guide, we will create a site queue worker definition, prepare its service, and verify background job processing. We will also cover safe configuration changes and stopping the runner. These source-rendered screens use fictional data. No queue, application command, or host service is operated in the demonstration.
Before you start, agree which jobs this worker may consume and how their effects will be verified. An administrator must manage the definition and service. Preserve application configuration and review existing consumers before changing concurrency. Prepare the backend, required tables and PHP CLI dependencies in the site application; a worker definition does not create that infrastructure.
Demonstration: Herne 3.55.43, English interface and narration, fictional Northstar Studio data. The form values illustrate one reviewed definition, not universal defaults. No definition is submitted, no queue is accessed and no job, backend migration or service operation is executed. Written guidance and selectable subtitles are available in six languages.
English audio · 6 min 14 sec · Subtitles in all six site languages.
1. Open the correct site and prepare the backend
Open Sites, select the intended site, then choose Runtime and Queue workers. A site owner can inspect the list and details. Creating definitions, editing settings, and service actions require an administrator. This runner processes your application’s queued jobs; the panel’s own background worker and the Laravel scheduler are separate.
Use an active, working Laravel site with a supported PHP version and artisan in its canonical project directory. Prepare the queue backend in the application first. A database queue needs its configured jobs table. Keep the application’s storage and cache directories writable for the site’s private execution group.
2. Configure connection, queues and worker options
Select Create worker and give the definition a recognizable name. Connection is the queue connection name from the application configuration. It is not a database name or a credential field. The example uses database; use a connection your application actually configures and can reach from its site runtime.
Enter queue names separated by commas. The example listens to default. Match the names used when your application dispatches jobs, and review their order and priority. Check existing workers before adding another consumer. Additional workers change concurrency, so their number and overlapping queue coverage need an application-level plan.
Tries sets the worker’s attempt limit. Timeout bounds a job’s execution time; Backoff delays a retry after an exception. Sleep controls polling when the queue is empty. Memory is Laravel’s worker memory threshold in mebibytes, not a host resource quota. Review application job overrides before accepting the example values.
The effective connection retry_after must be greater than the worker Timeout. Herne checks this during provisioning. With the example timeout of sixty seconds, a retry interval of ninety seconds illustrates the required ordering; choose values that fit your jobs. Also review job-specific timeouts and backend behavior to reduce unintended duplicate processing.
| Setting | Example | Accepted definition range |
|---|---|---|
| Tries | 3 | 1–100 |
| Timeout | 60 | 1–86400 |
| Backoff | 10 | 0–86400 |
| Sleep | 3 | 0–60 |
| Memory | 128 | 64–4096 MiB |
Timeout, Backoff and Sleep are in seconds. Name accepts at most 80 ASCII letters, numbers, spaces, dots, underscores or hyphens. Connection accepts at most 32 letters, numbers, underscores or hyphens. Supply 1–10 queue names of at most 64 characters each, using letters, numbers, underscores, dots, colons or hyphens. Queue order affects consumption priority. The shown values are examples; new-form defaults include Tries 1 and Backoff 0. Use ASCII letters for Connection and queue names too.
For the numeric example, timeout = 60 and effective retry_after = 90 satisfy Herne’s strict comparison. Herne 3.55.43 requires a positive effective retry_after greater than Timeout during provisioning. Backend drivers with different visibility semantics still need compatibility review; do not invent a setting just to pass the check. Individual jobs may override worker options such as $tries, $timeout and $backoff. Keep processing effects safe to repeat and inspect the real backend configuration. Laravel job timeout enforcement requires pcntl support in CLI PHP; have the server operator verify that capability.
3. Save, provision and start the service
Review the form, then use Save definition. In this web workflow, saving creates the definition without installing or starting its service. The details page initially shows Not provisioned. Herne derives the PHP executable, isolated site user and project directory; the form does not accept an arbitrary shell command or execution user.
Select Provision, read the confirmation and confirm when ready. Herne checks the application and effective queue configuration before installing the systemd unit. Provisioned Yes means the unit was prepared. Initial provisioning leaves it stopped. If a check fails, resolve the reported prerequisite before trying another lifecycle action.
Enable configures automatic start at server boot. Start runs the worker now. Disable removes the boot setting without stopping a running service. The details screen does not show a separate enabled-at-boot row in this version. Ask the administrator to verify that policy independently; always inspect the observed running state as well.
Select Start and review the confirmation. Starting can immediately consume pending jobs and cause their application effects. Confirm only after reviewing the queue contents and intended workload with the application owner. Return to the details page and check for Active, then verify an expected job result in the application.
4. Verify observed state and job outcomes
The list separates Status from Desired. Status is the service observation when the page loads. Desired records the intended state tracked by the panel. Running in Desired does not prove that the service is Active. Reopen details after an action and verify both service behavior and actual job completion.
Recent logs shows a bounded service journal. Combine it with application logs, queue backlog and failed-job records. An active but idle worker may simply have no matching job. Do not retry failed jobs blindly: confirm the cause and whether repeating their effects is safe. This demonstration journal is fictional.
5. Coordinate edits and deployments
Use Edit to review a definition change. Saving an already provisioned worker marks its definition as needing reconfiguration; it does not apply the new service parameters immediately. Coordinate the change, provision the reviewed definition, then activate it with an appropriate Start or Restart. Verify the resulting service and workload again.
After a successful deployment, Herne requests a graceful queue restart when an enabled worker definition exists. Check the deployment log, then recheck the actual worker. A clean Laravel exit may leave the current service stopped. If needed, review and use Start, then confirm that jobs are processed by the new application code.
Current implementation detail: the generated unit uses Restart=on-failure, while a normal Laravel queue:restart exit is successful. Automatic relaunch after that clean exit is therefore not guaranteed. Verify actual service state after deployment or a graceful restart request and use a separately reviewed Start when needed. A systemd Restart can interrupt work: the generated stop allowance is the worker Timeout plus 60 seconds, after which remaining processes may be terminated.
6. Pause, troubleshoot and retire carefully
To pause this runner, coordinate any in-flight job, then use Stop. Use Disable as well if it must remain off at the next boot. These actions do not delete queued or failed jobs and do not roll back completed effects. Verify Stopped and the backend state before a maintenance change or a replacement consumer.
If provisioning fails, distinguish an unavailable connection, a missing jobs table, and retry timing from a host service failure. Check the effective application configuration, including its cached values. Ask the responsible administrator to repair the specific prerequisite. Do not bypass site isolation, expand privileges, or move tenant queue commands into the shared crontab.
Finish by matching the application connection and queue names, checking the observed service state, and verifying a real job outcome. Keep retry timing, failed jobs and boot behavior under review as the application changes. A saved definition or successful service action is one step; the application result completes the check.
The current worker list and details views do not provide a Remove button. To stop consumption, use the reviewed Stop and Disable workflow. Removing a definition is a separate administrator API operation that requires the exact worker name as confirmation; it removes the managed unit and record, not queued payloads or completed application effects. Plan backlog ownership, in-flight jobs and failed-job retention before retiring or replacing a consumer. Redact credentials and private job data before sharing diagnostics.