Download the PHP package adamczykpiotr/laravel-balanced-queues without Composer

On this page you can find all versions of the php package adamczykpiotr/laravel-balanced-queues. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-balanced-queues

Laravel Balanced Queues

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Stop guessing how many queue workers you need. This package automatically optimizes worker counts based on job type (CPU-intensive, API calls, file downloads) and your server's resources.

Why You Need This

Running 10 workers for everything? You're wasting resources or creating bottlenecks.

Are you running your application on different machines? Different CPU core configurations, changing network bandwidth? With this package you can optimize it automatically and fine tune it for best results.

Quick Start

Tag your jobs with the right workload type using traits:

Run your queues:

Done. The package spawns all the queues with adjusted worker counts for each job type.

Available helpers

Helper method Workload Type Use Case
onHighCpuUsageQueue CPU_HIGH Large file processing ~MB/GB
onMediumCpuUsageQueue CPU_MEDIUM PDF generation, smaller file parsing (~KB/MB)
onLowCpuUsageQueue CPU_LOW Quick background queries
onHighNetworkRequestUsageQueue NETWORK_HIGH_BANDWIDTH Large file downloads (~ >10MB)
onHighNetworkBandwidthUsageQueue NETWORK_HIGH_REQUESTS API calls, webhooks
onFilesystemQueue FILESYSTEM Filesystem operations (duh!)

How It Works

By default, CPU_HIGH usage assumes 100-50% CPU utilisation for a single job, ~50-25% for CPU_MEDIUM and ~10-20% for CPU_LOW. Jobs on NETWORK_HIGH_BANDWIDTH are best suited for downloading large files that completely saturate network bandwidth whereas NETWORK_HIGH_REQUESTS are in most cases are bottleneck by neither network nor cpu and are offloaded on a queue simply to improve UX. FILESYSTEM jobs are assumed to be bottlenecked by disk I/O.

If the default configuration doesn't fully utilize your machine, adjust the following default configuration in config/balanced-queues.php:

The default configuration aims to ensure best results across wide range of cases. In order to get full benefits of this approach, it's highly recommended to fine-tune the configuration to your specific use-case. The clue to optimisation is to ensure a single queue can fully saturate the machine:

In case more than one queue is fully saturated, OS scheduler will balance processes CPU time accordingly.

Advanced Configuration

Custom Queue Names

VM / Docker CPU Limits

Override auto-detected CPU core count:

Worker Options

Add additional options to artisan queue:work command:

Supervisor Configuration

Customize the generated Supervisor configuration:

Commands

Docker container entrypoint example

Requirements

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-balanced-queues with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package adamczykpiotr/laravel-balanced-queues contains the following files

Loading the files please wait ...