laravel queues - how sync driver works? Does it executes in a separate process/thread or the main execution thread?

laravel queues - how sync driver works? Does it executes in a separate process/thread or the main execution thread?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Laravel Queues: How the Sync Driver Works

When you configure a queue driver to sync in your .env file, you are explicitly telling Laravel to bypass the message broker entirely. This approach is often misunderstood as being "fire-and-forget," but the execution model differs significantly from how database or Redis drivers function. Understanding exactly where these jobs run prevents architectural surprises, especially on shared hosting environments where daemon processes like Supervisor are unavailable.

With the sync driver, Laravel does not spawn a separate worker process to listen for new jobs. Instead, the job is executed synchronously within the same PHP request lifecycle that dispatched it. When you call dispatch() or $job->handle(), the framework queues the task in memory, executes the logic immediately, and then clears the job from the queue before the HTTP response is sent back to the client.

This behavior means the main execution thread handles everything. If your job involves heavy computation, long-running I/O operations, or blocking network requests, that work blocks the web server thread until completion. In a shared hosting environment using PHP-FPM, this can lead to slow page loads or timeouts if the script execution time limit is exceeded, as the web request cannot complete while waiting for the queue job.

To achieve true fire-and-forget behavior where resources are freed immediately after dispatching, you need an asynchronous driver like database, redis, or sqs. These drivers require a worker process to pick up jobs from a persistent store. The standard way to run these workers is via php artisan queue:work. On shared hosting, this presents a specific challenge: you cannot install Supervisor to manage these processes in the background.

However, Laravel provides a solution for single-process execution without daemons using the --once flag with the database driver. By running php artisan queue:work --queue=default --once, you spawn a process that listens for one job and exits immediately after completion. You can trigger this from your application code by dispatching to a specific queue name, though this still requires an external command or cron job to initiate the worker unless you are willing to run it manually or via a system timer.

If your requirement is strictly "execute now without waiting for a separate process," the sync driver is technically the only option that fits within a single HTTP request. However, it violates the core principle of queuing: offloading heavy work. If you must use the sync driver to avoid external processes on shared hosting, ensure your jobs are lightweight and synchronous I/O operations do not block the main thread for extended periods.

For scenarios where you need to trigger a job but cannot maintain a persistent worker process, consider using a cron-based approach. You can configure a system cron job that runs php artisan queue:work --once every minute or on a schedule matching your notification frequency. This decouples the web request from the execution logic while adhering to shared hosting limitations.

Alternatively, some hosts offer "Laravel Forge" or managed CLI tools via SSH. If you have SSH access, you can run php artisan queue:work --once directly after dispatching a job in your code, ensuring the job completes before closing the connection. This method provides the asynchronous behavior of a dedicated driver without requiring a long-running daemon process.

Ultimately, the choice depends on whether you prioritize immediate resource release or single-request simplicity. The sync driver offers the latter but risks blocking the web server, while database drivers with --once offer the former at the cost of requiring an external trigger mechanism.

Our network