Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Laravel queue workers are long-lived processes, so they keep the application code loaded at startup. When a worker receives SIGTERM while processing a job, Laravel documents that it finishes the active job before exiting—provided the host gives it enough time. For a typical self-managed deployment, deploy the new code, run php artisan queue:restart, and let a process monitor start replacement workers.

What happens when Laravel receives SIGTERM?

Laravel’s 13.x queue documentation says a worker receiving SIGQUIT, SIGTERM, or SIGINT while processing a job finishes that job before exiting. This is graceful shutdown behavior, not a guarantee that a job can outlast the host’s shutdown deadline. If a container or host forcibly kills the process when its grace period ends, the job may not finish.

A worker is long-lived: it does not automatically load newly deployed application code. Reload or restart workers after deploying so new processes run the new code. Laravel’s deployment guide recommends reloading or restarting long-running services after a deployment. Laravel queue documentation · Laravel deployment documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to gracefully restart workers during a self-managed deployment

  1. Deploy the new application code. Keep the deployment process and worker environment aligned so replacement workers start from the intended release.
  2. Run php artisan queue:restart in the application context. Laravel records the restart signal in the cache. The workers check for it and exit after their current job.
  3. Have a process monitor replace exited workers. Configure a supervisor such as Supervisor to start replacement processes; queue:restart tells workers to exit, it does not itself keep them running.
  4. Confirm the restart cache is shared and working. The command and workers need to use a cache configuration through which workers can observe the restart signal. A process-local or nonpersistent cache can prevent that coordination.
  5. Check the shutdown and retry timings. Ensure the worker timeout, queue retry timing, job duration, and host’s termination grace period work together.

Laravel’s documentation gives 60 seconds as the default worker --timeout; that is a default, not a universal setting for every job. It advises setting --timeout several seconds shorter than retry_after. Otherwise a job may be retried while the original worker is still processing it, creating a risk of duplicate execution. For Amazon SQS, account for the queue’s visibility timeout as the analogous retry control. Make jobs idempotent when duplicate execution could cause harm. Laravel queue documentation

How Laravel shutdown options differ

Mechanism What it does What to configure
php artisan queue:restart Uses Laravel’s cache-based restart signal; workers exit after their current job. Make the cache signal visible to the workers and configure a process monitor to replace them.
php artisan reload Terminates reloadable long-running services for deployments managed outside Laravel Cloud. Use it where appropriate for the services in the application and ensure they are supervised.
Infrastructure SIGTERM Requests that a process stop. Laravel documents that a queue worker finishes its active job before exiting when it receives the signal during processing. Check the specific host or orchestrator’s shutdown grace period; Laravel does not set that external deadline.

These mechanisms are related but not interchangeable: the Artisan commands coordinate through Laravel, while an infrastructure signal is sent by the process manager, host, or orchestrator. Laravel Cloud handles graceful service reloads automatically, according to its deployment documentation. For other deployment environments, configure the process monitor and shutdown policy yourself. Laravel deployment documentation

When a job should handle interruption itself

Ordinary jobs can rely on Laravel’s documented behavior of finishing the active job before a graceful worker exit. For long-running work—such as an import—that should stop fetching new records and save progress, implement IlluminateContractsQueueInterruptible and define the job’s interrupted method. Laravel passes the received signal number to that method. Treat this as a job-level opportunity to stop cleanly and persist progress, not as protection against a hard kill after the platform’s shutdown window.

Persist progress so a retry can safely resume or repeat work. This complements, rather than replaces, compatible timeout and retry settings. Laravel queue documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What Laravel 13.31 changes—and what it does not

Laravel Framework v13.31.0, dated September 8, 2026 in the official changelog, adds connection and queue information to the WorkerStopping event when a worker is killed. This is useful context for code observing that event; it is not the introduction of graceful SIGTERM handling or the Interruptible job contract, which are documented in Laravel 13.x queue documentation. Check the installed patch version before relying on the added event context. Laravel Framework 13.x changelog

Deployment checks before relying on graceful exit

  • Workers and the Artisan command use a functioning, shared cache for restart signals.
  • A process monitor replaces workers after they exit.
  • --timeout is several seconds shorter than retry_after, or the relevant SQS visibility timeout.
  • The platform’s SIGTERM grace period is long enough for the expected job duration and shutdown work.
  • Jobs that may be retried can safely resume or run again.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.