~/docs
Resonate
Resonate
2.x 2.4.0, current
Torque
Toggle sidebar
Torque
webpatser/torque 2.4.0

Torque 2.x

Commands

The torque artisan commands with their arguments and options.

torque:start

Starts the master and its worker processes.

php artisan torque:start --workers=8 --concurrency=100 --queues=emails,notifications
Option Description
--workers= Number of worker processes
--concurrency= Slots per worker
--queues= Comma-separated queue names
--replace Absorb a running master through the takeover handshake instead of refusing to start. Use as the supervisor program command
--takeover= Internal: replace the running master with this PID (used by torque:reload). Mutually exclusive with --replace

torque:stop

Graceful shutdown with SIGTERM. Like horizon:terminate, it exits 0 when no master is running, also for a stale PID file whose number now belongs to an unrelated process (warned, not signalled, file left in place, orphaned workers swept). It exits 1 on a symlinked PID file, on a live process whose command line cannot be read, or when SIGTERM cannot be sent.

Option Description
--force Send SIGKILL instead of SIGTERM
--timeout= Seconds to wait for a graceful shutdown before SIGKILL. Default: the drain worst case, reload_pause_seconds plus drain_grace_seconds plus slack

torque:status

Shows worker metrics, throughput, queue depths, the recorded data version next to the installed one, a line per tripped circuit breaker and a Respawns owed line while any are owed. No options.

torque:monitor

Live terminal dashboard for workers.

Option Description
--refresh=500 Refresh interval in milliseconds

torque:tail

Tails a job's event stream.

php artisan torque:tail --job=<uuid>
php artisan torque:tail --latest
Option Description
--job= Job UUID to tail
--latest Tail the most recently queued job
--timeout=60 Seconds to wait for events before stopping

torque:pause

Pauses, resumes or toggles processing. In-flight jobs complete. Dispatches WorkerPausing and WorkerResuming.

php artisan torque:pause
php artisan torque:pause continue
Argument Description
action pause, continue or toggle (default)

torque:reload

Reloads the master with zero downtime. See Deployment.

Option Description
--drain Only signal the running master to drain; do not spawn a replacement
--if-running Exit successfully when no master is running instead of failing
--force Spawn a takeover master even when the running master is supervised
--timeout= Seconds to wait for the old master to exit after the drain signal. Default: the drain worst case
--health-timeout=45 Seconds to wait for the new master to take over the PID file

torque:prune

Trims the dead-letter stream (TTL and cap) and deletes stale stream consumers.

php artisan torque:prune --dry-run
php artisan torque:prune --dead-letter-max=50000 --consumer-idle=3600
Option Description
--dead-letter-max= Hard cap on dead-letter entries. Defaults to dead_letter.max_entries
--consumer-idle= Whole seconds, 0 or more, default 3600, also with --deep. A consumer without pending work must be idle this long before it is deleted; each delete re-checks the pending list atomically
--deep Also sweep orphaned job streams, stale index members and stale worker hashes
--dry-run Report what would be removed without touching Redis

torque:forget

Deletes a dead-letter entry by its stream id (like 1700000000000-0, shown by the dashboard and torque:tail), or every entry with --all. UUIDs and queue:failed ids are rejected. Only database-uuids failed_jobs rows are removed with the entry; --all leaves rows that have no dead-letter entry. The equivalent of horizon:forget.

Argument or option Description
id Dead-letter stream id
--all Remove every dead-letter entry, after confirmation
--queue= With --all, only entries from this queue
--force Skip the confirmation prompt

torque:flush

Flushes pending and delayed jobs from Torque queues. It removes the job event streams of the selected queues' unclaimed and delayed jobs only; keys of claimed and dead-lettered jobs, and orphans, are left to their TTL and torque:prune --deep. An empty or invalid --queues value exits with an error.

Option Description
--force Force flush in production
--queues= Comma-separated queue names. Default: all configured

torque:supervisor

Generates a Supervisor config file. See Deployment.

Option Description
--path= Output path, must be inside storage_path()
--stdout Print the config instead of writing a file. --path is ignored
--user= Process user
--workers= Number of worker processes
--php= PHP binary for the command= line. Default: the running PHP binary
--app-path= Application root for artisan and logs. Default: the Deployer current symlink, or base_path(). Must be absolute

torque:bench

Benchmarks end-to-end throughput and latency. See Benchmarks.

Option Default Description
--jobs= 10000 Total jobs to enqueue, warmup included
--workers= 4 Worker count recorded in run metadata
--coroutines= 50 Slots per worker recorded in run metadata
--workload= mixed cpu, io, async-io, fanout, mixed, payload-small or payload-large
--serializer= json Serializer recorded in run metadata (json or igbinary); the fleet's TORQUE_SERIALIZER decides the encoding
--warmup= 500 Leading samples to discard
--use-running-master off Required in v1: assumes torque:start is already running
--json= none Write JSON results to a path, or - for stdout
--force off Allow running in production

Internal commands

torque:worker (options --queues=default, --concurrency=50) is started by the master and hidden; use torque:start. torque:long-wait-alert is hidden and started by the master to send one long-wait alert.

  • php artisan queue:pause torque:<queue> and queue:resume pause and resume one stream. queue:pause --all pauses the worker. Both are honoured.
  • php artisan queue:restart is seen by workers. cache:clear does not drain workers.
  • php artisan make:queue-batches-table creates the table the dashboard's batches page needs.
  • Schedule::command('queue:prune-failed --hours=168')->daily(); prunes the framework's failed_jobs table, which the dead-letter cap does not touch.