Yep, we actually persist the individual jobs to the database too. 😅
The metrics/heartbeats used by Autoscale live in Redis, while Queue Monitor batches the job persistence to the DB. We’re running many millions of jobs a day through Autoscale + Monitor with this setup without the monitoring writes becoming an issue so far.
Definitely one of the things I wanted to make sure would scale when building it.
Laravel queues are great.
Until you have no idea what they’re actually doing. 😅
I built cboxdk/laravel-queue-monitor to make queue activity a little less invisible.
It uses Redis for monitoring, but otherwise stays out of the way. It works with vanilla Laravel queues, Horizon, Queue Autoscale, and across all queue drivers.
See what’s running, failing, retrying, or taking longer than expected.
No big monitoring platform required. Just visibility into the queues you already have.
https://t.co/OXsVGy3g3x
A bit more context on the “runtime” part, because this turned into a bigger rabbit hole than just building Docker images.
The images dogfood three other Cbox projects:
cbox-init is PID 1 and handles process supervision, dependencies, health/readiness, graceful shutdown, hooks, etc. https://t.co/dVKuPPFOpQ
fpm-tune measures actual PHP-FPM worker memory/CPU usage and adjusts pm.max_children from the workload it sees, rather than guessing a number upfront. https://t.co/2uDo1d3wgS
fpm-exporter exposes FPM, Opcache and Laravel metrics to Prometheus. https://t.co/a8iu3k5eky
The dogfooding part has probably been the most useful bit.
Running these together has already exposed real bugs and edge cases in the individual projects, which then get fixed upstream and fed back into the images.
So while php-baseimages started because I was tired of installing the same extensions and fixing the same container/permission issues, it has gradually become the integration point for how I think a boring, observable PHP-FPM runtime should work.
I think we’ve over-optimized Docker images for being small.
I don’t care if my PHP image is 80MB smaller.
I care that it has the extensions I use, permissions just work, FPM isn’t configured by guesswork, and I don’t need 100 lines of Dockerfile to ship an app.
So I built that.
https://t.co/rZsPSaBvTN
Thanks! It’s deliberate.
My concern isn’t FrankenPHP itself, but long-running workers. State surviving between requests adds failure modes around security, predictability and debugging that I generally prefer to avoid.
I’ve done a lot of PHP benchmarking, including while working on Laravel Cloud, and with real Laravel apps I never saw performance gains big enough to justify that tradeoff. That may have improved since.
FPM is boring: request in, response out, state gone. With proper tuning and observability, that’s still my preferred tradeoff.
fpm-tune has grown a bit since I posted it 🙂
It now has a simple top TUI, and CPU-aware limits landed too.
Memory still decides what can safely fit. CPU can now put a ceiling on that, so a busy FPM pool doesn't just keep adding workers when the cores are already full.
Quite useful on shared boxes where PHP isn't the only thing that needs to stay responsive.
Still beta, still moving fast:
https://t.co/2uDo1d3wgS
Short answer: we're not running WordPress 😂
Jokes aside, that's a really good question, and it actually exposes a gap in the current package.
CPU and memory exhaustion have very different failure modes, but fpm-tune can't create more of either. Once the server is genuinely out of capacity, you need to scale.
CPU saturation mostly makes things slower. Memory pressure can end with the OOM reaper killing processes, especially with containers/cgroups.
I do have optional CPU-aware limits coming in the next release. Mostly as a guardrail to stop FPM spawning more workers than the CPU can reasonably serve.
Requests may queue and eventually time out instead, but on a shared box I'd rather contain the pressure in PHP than have one pool drag MySQL, Redis and everything else down with it.
Most of us just guess pm.max_children.
And honestly, that worked pretty well when the cheap answer was always “give the box more RAM”.
But hardware isn’t getting cheaper, so I’ve been playing with making PHP-FPM use what it’s given a bit smarter.
I ended up pulling my existing tuning logic into its own sidecar: fpm-tune.
https://t.co/2uDo1d3wgS
Love seeing this in the wild! 🙌
That’s exactly the problem I wanted to solve: make pm.max_children and FPM behaviour something you can actually see and reason about, instead of tuning it by gut feeling.
And yeah, I’d love to see this kind of visibility built into Forge someday 👀 Well, already using it on my Forge servers to autotune and monitor php-fpm. 🚀
@vic_cherubini Haha, exactly 😅 “Not OOMing” has been a surprisingly effective PHP-FPM tuning strategy for years.
I figured there had to be something between that and obsessively tuning it by hand 🙂
Totally agree 😅 An early version of some of this actually lives in my elasticphp-agent, which provides FPM metrics in Laravel Cloud, so I have a tiny footprint there already.
I also pulled the observability part out separately if you just want the insight without tuning:
https://t.co/a8iu3k5eky
Would love to see something similar exposed in Forge too.
Yep, that's a solid setup 🙂
This started in a similar place.
I've since moved to PSS rather than RSS because of OPcache/shared pages.
The rabbit hole was making the whole thing dynamic over time, while keeping FPM a good neighbour.
MySQL, Redis etc. need RAM too, workloads change, and multiple FPM pools still have to safely share what's actually available.
A bit of context: this started as tuning logic inside my PID 1/init package.
I pulled it out, iterated on it quite a bit, and made it standalone so it can run alongside existing setups too. Forge, Ploi, regular VMs, etc.
Same idea, without needing my whole runtime 🙂
For the third year in a row, Laravel Live Denmark returns next week to Werkstatt at Refshaleøen. A fan favorite among attendees, the venue combines industrial character with Reffen’s creative atmosphere, food stalls, and waterfront views.
Thanks for the shoutout, Povilas! 🙌
I’ve been quietly building and open sourcing these over many years, mostly from real problems I’ve needed to solve in production. A lot of them lean towards infrastructure, security, scaling and the more boring enterprise stuff rather than small Laravel helpers.
I recently realized I’ve done a terrible job of actually telling anyone they exist 😅 So I’m slowly changing that. Really appreciate you sharing them!
Feedback, issues and ⭐s are very welcome. There’s quite a bit more coming too.