Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Queue Autoscale Laravel Package

cboxdk/laravel-queue-autoscale

Laravel Queue Autoscale automatically adjusts the number of queue workers to match your workload, scaling up when queues back up and down when they're idle so jobs keep processing promptly while you avoid paying for idle workers.

View on GitHub
Deep Wiki
Context7

Getting Started

This release is a bug-fix/minor release; if you already run the package, start by upgrading and restarting every long-running queue:autoscale process. There are no config changes.

First steps for a new or upgraded install:

  1. Install/upgrade the package and publish its config if you have not already.
  2. Run the diagnostic command against the connections you intend to scale:
    php artisan queue:autoscale:doctor
    
    Pay particular attention to any custom queue connections. As of v4.6.1, subclasses of SqsQueue now receive the SQS-specific doctor checks (dotted queue names, missing SLA signal) that were previously skipped.
  3. Run the autoscaler against one queue:
    php artisan queue:autoscale --queue=default
    
  4. Inspect how the package classifies a connection using the new helper:
    use Support\QueueDriver;
    
    QueueDriver::of('my-custom-connection'); // built-in driver it behaves as
    

The first practical use case is a custom queue driver that wraps a built-in one. If you have registered Queue::extend('my-redis', ...) returning a RedisQueue subclass, this release makes the autoscaler, cluster summary and console treat it as Redis rather than as an unknown driver.

Implementation Patterns

Register custom drivers normally with Queue::extend(). The package resolves the connection once per process and inspects the underlying queue object:

Queue::extend('tenant-redis', function () {
    return new TenantRedisQueue(config('queue.connections.tenant-redis'));
});

If TenantRedisQueue extends RedisQueue, it now gets Redis behaviour everywhere: engine, cluster summary and console. A subclass of SqsQueue gets the SQS doctor checks. A subclass of BackgroundQueue, SyncQueue, DeferredQueue or NullQueue is treated as a workable queue.

Prefer extending a built-in queue over implementing Queue from scratch. The package only understands built-ins it can recognise. A driver that extends no built-in queue is judged by its driver name, exactly as before, which means the autoscaler may not know how to report oldest job age or may treat a recovered queue as breached.

Use QueueDriver::of() as an extension/diagnostic point. It is useful in your own health checks, tests, or operational commands where you need to know how the package will classify a connection without duplicating the subclass-detection logic.

Watch for SQS subclass behaviour changes. If you previously subclassed SqsQueue and relied on the doctor not running SQS checks, those checks now run. Dotted queue names and the SLA signal become relevant, so make sure your subclass exposes the same SQS semantics the package expects.

Restart is part of the deployment pattern. Because the resolved instance is cached for the lifetime of the autoscale process, treat queue:autoscale like a queue worker: restart it after every deploy that changes queue drivers or upgrades this package.

Gotchas and Tips

  • Restart queue:autoscale after upgrading. The manager now holds one resolved instance of each custom connection for the process lifetime. A process started before the upgrade will not pick up the new classification.
  • Failed resolution is cached until the process restarts. If a broker is down or credentials are missing at first resolution, the connection is judged by its driver name and the package will not retry. Fix the broker/credentials and restart the autoscaler, or the process will keep using the fallback classification.
  • Built-in drivers are never resolved. There is no overhead or behaviour change for connections on standard redis, database, sqs, sync, etc. The new resolution path only affects connections on custom driver names.
  • A subclass of BackgroundQueue, SyncQueue, DeferredQueue or NullQueue is now workable. Do not extend these as a base for a custom asynchronous driver unless you want the package to treat jobs as runnable by a worker.
  • Extending nothing means driver-name classification. If your custom driver implements Queue directly rather than extending a built-in, the package will not infer capabilities. Either extend the closest built-in queue or accept the pre-existing driver-name fallback.
  • Re-run queue:autoscale:doctor for SQS subclasses. Checks that were previously skipped because the driver name was unrecognised now execute. A failing check after upgrade is a real configuration finding, not a regression.
  • Dotted queue names and missing SLA signals are SQS-specific doctor failures. They now apply to SqsQueue subclasses; verify the queue name format and that your metrics source supplies the SLA signal.
  • Recovered queues on custom Redis/Database subclasses are no longer held as breached, and oldest-job-age reporting now works. If you built workarounds for the old behaviour, remove them.
  • The cboxdk/laravel-queue-metrics 3.5.1 change is test-only. No runtime action is needed for that part of the release.
  • Support\QueueDriver::of() is the supported extension point for classification; avoid reimplementing subclass checks in your own code, as the package's list of recognised built-ins may evolve.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect