Weave Code
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 Dynamic Servers Laravel Package

spatie/laravel-dynamic-servers

Dynamically spin up and destroy servers from Laravel to handle variable queue workloads. Uses provider snapshots as templates and lets you determine server count (e.g., based on Horizon wait times) so extra workers are created automatically and removed when no longer needed.

View on GitHub
Deep Wiki
Context7

title: Manually increasing and decreasing servers weight: 6

Instead of relying on the ensure method, you can manually increase and decrease servers.

use Spatie\DynamicServers\Facades\DynamicServers;

DynamicServers::increase() // add one more default server
DynamicServers::increase(3) // add three more default servers
DynamicServers::increase(type: 'big') // add one more `big` server
DynamicServers::increase(5, type: 'big') // add five more `big` servers

DynamicServers::decrease() // destroy one default server
DynamicServers::decrease(2) // destroy two default servers
DynamicServers::decrease(type: 'big') // destroy one `big` server
DynamicServers::decrease(3, type: 'big') // destroy one `big` servers

Be aware that calling ensure($numberOfServers) will simply ensure that there are the number of servers giving available. It doesn't take into account any calls you made to increase or decrease previously.

Determine how many servers are provisioned

To know how many dynamic servers are provisioned (servers that are starting, running or rebooting) you can call provisionedCount:

use Spatie\DynamicServers\Facades\DynamicServers;

DynamicServers::provisionedCount(); // returns an int
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport