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 Rate Limit Laravel Package

mxl/laravel-queue-rate-limit

mxl/laravel-queue-rate-limit lets you throttle Laravel queue jobs per queue, capping how many are processed in a given time window. Configure limits in your queue config to protect external APIs and downstream services from job bursts.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package extends Laravel's native queue worker lifecycle, specifically the interaction between queue:work --stop-when-empty and queue-level rate limiting. This is a narrow but operationally significant seam: it sits between the Worker loop, the queue driver, and the rate-limiter backend (typically Redis or cache).
  • Fits applications that run rate-limited jobs on Redis/database/SQS-style queues and rely on --stop-when-empty for batch-style or ephemeral worker invocations (CI jobs, cron-triggered drains, one-shot container tasks).
  • The v3.6.1 change corrects a semantic bug rather than introducing new surface area, so the architectural footprint is unchanged.

Integration feasibility

  • Drop-in patch upgrade. No new configuration, migrations, service providers, or public API changes are described.
  • Upgrade is a Composer constraint bump (3.6.x → 3.6.1) plus a dependency refresh; low integration effort.
  • Verify supported Laravel/PHP matrix and queue drivers against the project's actual versions before merging.

Technical risk

  • Low for API compatibility; moderate for runtime semantics.
  • The behavioral change is the key risk: a worker invoked with --stop-when-empty will no longer exit when the only remaining jobs are pending behind a rate-limit window. It will wait for the nearest window and retry. Any orchestration that assumes prompt process exit—cron wrappers, CI steps, Kubernetes Jobs, Supervisor stopwaitsecs, deploy scripts draining queues—must be re-validated.
  • Preserved behaviors (empty-queue exit, multi-queue ordering) reduce regression surface, and the added regression tests are a positive signal of release discipline.

Key questions

  • Which queue drivers and rate-limiter backends are covered by the fix and its regression tests?
  • How is the "nearest rate-limit window" computed, and is the wait bounded? Is there a maximum wait, or can a worker block indefinitely if the limiter never releases?
  • How does the wait interact with --max-time, --timeout, --sleep, and --tries?
  • Is the new behavior configurable or opt-out, or is it unconditional in 3.6.1?
  • Are events/metrics emitted while waiting (e.g., rate-limited wait counters) for observability?
  • Is the package Horizon-aware, and does Horizon's worker management bypass or inherit this behavior?

Integration Approach

Stack fit

  • Assumes a standard Laravel queue stack with a shared rate-limiter store. Confirm the project's Laravel version, PHP version, and queue driver are within the package's supported range.
  • If Horizon is in use, clarify whether Horizon-managed workers exercise the same code path or whether the fix only applies to raw queue:work.

Migration path

  • composer update the package to 3.6.1; no config publishing or data migration expected.
  • No schema or cache-key changes are indicated, so rollback is a simple version pin.
  • Run the existing test suite plus the package's new regression scenarios in staging before production.

Compatibility

  • Backward compatible per the release notes: empty-queue behavior and multi-queue processing order are explicitly preserved.
  • Watch for indirect incompatibility with custom worker wrappers or packages that decorate queue:work (e.g., custom commands, tenancy-aware queue packages, or orchestration shims that parse worker exit codes).

Sequencing

  1. Inventory every invocation of queue:work --stop-when-empty (cron, CI, deploy scripts, Kubernetes Jobs, batch drain tooling).
  2. Upgrade in staging and reproduce a rate-limited pending-queue scenario; confirm the worker waits and then drains rather than exiting.
  3. Validate --max-time and timeout interactions; add a bounded guard where scripts previously assumed fast exit.
  4. Update runbooks and deployment scripts to tolerate longer-lived workers.
  5. Roll out to production during low-traffic windows; monitor worker lifetime and queue drain latency for one cycle.

Operational Impact

Maintenance

  • Low maintenance burden: patch release, no configuration drift, no deprecations announced.
  • Track the vendor's release cadence; the fix touches worker control flow, so future patches in this area deserve targeted regression testing.

Support

  • Vendor-supported with explicit regression coverage for the three affected scenarios (rate-limited pending queue, empty queue, multi-queue rate limits). This reduces the need for internal workarounds and fork maintenance.
  • Internal support teams need a short briefing on the changed exit semantics, since it alters observable behavior of a familiar command.

Scaling

  • Waiting workers occupy a process slot while blocked on a rate-limit window. Under aggressive limits, throughput is bounded by the limiter, not by worker count; adding workers may increase idle-waiting without improving drain rate.
  • For batch/CI use, prefer --max-time to cap worker lifetime and prevent long-hanging jobs.
  • Monitor worker concurrency and queue age; distinguish "rate-limited" from "stuck."

Failure modes

  • Indefinite wait if the rate-limit window never opens (misconfigured limiter, Redis/cache outage, clock skew across workers affecting window calculation).
  • Cron or CI steps that previously exited quickly may now hang until an external timeout kills them, producing ambiguous exit codes.
  • Supervisor/Kubernetes stopwaitsecs or grace periods may terminate waiting workers mid-wait, causing retries and duplicate-safe job assumptions to matter.
  • Alert on worker runtime exceeding expected bounds and on rate-limiter backend errors.

Ramp-up

  • Minimal engineering ramp-up: no new APIs or configuration to learn.
  • The real ramp-up is operational: updating deployment scripts, cron wrappers, and on-call runbooks to reflect that --stop-when-empty now means "stop when empty or when pending work is permanently blocked," not "exit promptly when nothing is immediately runnable."
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums