PHPackages                             diegodevgroup/beanworkers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. diegodevgroup/beanworkers

ActiveLibrary

diegodevgroup/beanworkers
=========================

A way to dynamically control the number of processes that Supervisord will have running at any given time

1.0.0(9y ago)015MITPHPPHP &gt;=5.3.0

Since Feb 7Pushed 9y ago2 watchersCompare

[ Source](https://github.com/DiegoDevGroup/beanworkers)[ Packagist](https://packagist.org/packages/diegodevgroup/beanworkers)[ RSS](/packages/diegodevgroup-beanworkers/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Beanworkers
===========

[](#beanworkers)

This is a command line script to automatically update the number of processes in supervisord dynamically based on number of ready jobs in a beanstalk tube(s)

Usage is simple, but there are assumptions made. Please ensure you have a backup before attempting to use this code.

Assumptions
===========

[](#assumptions)

1. Supervisord programs are listed individually in separate ini files.
2. You are running this as a user that has access to edit ini files and run `supervisorctl`

Example
=======

[](#example)

```
$pheanstalk = new \Pheanstalk\Pheanstalk("$host:$port");
$worker = new Supervisord\Beanstalkd\Workers($pheanstalk, '/usr/bin/supervisorctl');
$worker->addIniFile('default', '/etc/supervisord.d/default.ini');
$worker->addRules('default', ['minimum_jobs' => 0, 'required_workers' => 1]);
$worker->addRules('default', ['minimum_jobs' => 10, 'required_workers' => 3]);
$worker->run();

```

In the above example, the worker gets the stats of the default tube, and if there are less than 10 jobs currently ready, it will set the numprocs to 1. If there are 10 or more, it will set numprocs to 3. It will then update supervisord via `supervisorctl`.

Add to cron
===========

[](#add-to-cron)

Your script should probably run every minute.

Add as many rules as you like, just keep your resources in mind as you do so.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3383d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6254889bd63fd4e341e3c4a80af241eeddd7ab3598cec014aaabf5e90471a677?d=identicon)[diegodevgroup](/maintainers/diegodevgroup)

---

Top Contributors

[![johncongdon](https://avatars.githubusercontent.com/u/67472?v=4)](https://github.com/johncongdon "johncongdon (8 commits)")

---

Tags

beanstalksupervisord

### Embed Badge

![Health badge](/badges/diegodevgroup-beanworkers/health.svg)

```
[![Health](https://phpackages.com/badges/diegodevgroup-beanworkers/health.svg)](https://phpackages.com/packages/diegodevgroup-beanworkers)
```

###  Alternatives

[leezy/pheanstalk-bundle

The LeezyPheanstalkBundle is a Symfony Bundle that provides a command line interface for manage the Beanstalkd workqueue server &amp; a pheanstalk integration.

1231.8M7](/packages/leezy-pheanstalk-bundle)[symfony/beanstalkd-messenger

Symfony Beanstalkd Messenger Bridge

19357.4k2](/packages/symfony-beanstalkd-messenger)[udokmeci/yii2-beanstalk

Yii2 Beanstalk Client at the top of Paul Annesley's pheanstalk

69125.3k3](/packages/udokmeci-yii2-beanstalk)[mikopbx/core

Free PBX system for SMB based on Asterisk

5271.4k](/packages/mikopbx-core)[pmatseykanets/artisan-beans

Easily manage your Beanstalkd job queues right from the Laravel artisan command

4482.1k](/packages/pmatseykanets-artisan-beans)[jimbojsb/bstools

beanstalkd tools

635.3k](/packages/jimbojsb-bstools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
