Made an image compressor where you set how good the result must look, not a quality setting.
It finds the smallest file that still looks that close to the original, and shows you where the image changed.
Free, no sign-up. PNG, JPG, WebP, AVIF, GIF, HEIC.
https://t.co/BEAQYxFfZQ
@GTCrais@freekmurze Fair! I've run it for ~3 weeks on 4 production sites (~50K jobs a day) with no problems so far. If a safety check fails it falls back to stock workers on its own, and QUEUE_PREFORK=false turns it off completely.
@tomschlick@freekmurze@laravel I sent it to a couple of people at Laravel after the release, but being new to X, I don't think it ever reached them ๐ If you try it on your workers, I'd love to hear the numbers.
@myzoapp@freekmurze Its saves up to 80% RAM if you are running more than one worker on queue:work or any number of workers on Laravel Horizon (and uses half as much CPU and starts workers 6x faster).
And you don't have to change anything in your code.
@apnahive Nice for the per-worker cap. What it can't fix is that every worker carries its own copy of the compiled app. queue-prefork shares that copy across workers: 8 workers 645 โ 192 MB, no code changes.
A Laravel Horizon worker takes ~56 MB.
A Laravel Cloud Flex box has 2 GB.
So it fits about 30 workers, right?
Wrong. It fits 210 with queue-prefork.
The same 210 on stock Horizon needed a Pro 16 GB box: $128/mo instead of $24.
Running Laravel queues with queue:work or Horizon?
Every worker boots your whole app and keeps its own copy of the compiled code in memory. 8 workers, 8 copies.
I made them share one: โ70% memory for queue:work, โ81% for Horizon. Drop-in, no code changes.
@adambalee If you ever decide to bring the checks back into Laravel: queue-prefork should take those 50โ60 Horizon workers from ~4 GB to about 1 GB, with no code changes.
https://t.co/ykjGU3r6Hq
Running Laravel queues with queue:work or Horizon?
Every worker boots your whole app and keeps its own copy of the compiled code in memory. 8 workers, 8 copies.
I made them share one: โ70% memory for queue:work, โ81% for Horizon. Drop-in, no code changes.
Running Laravel queues with queue:work or Horizon?
Every worker boots your whole app and keeps its own copy of the compiled code in memory. 8 workers, 8 copies.
I made them share one: โ70% memory for queue:work, โ81% for Horizon. Drop-in, no code changes.
Something I measured lately: a Laravel Horizon supervisor takes ~56 MB of RAM, almost as much as a worker (~63 MB), and it never runs a single job.
6 supervisors โ 340 MB just to keep your queues organised.
I've been working on that. More soon.
@BoringO11y No, I kept it all PHP and Horizon's own code. Supervisors and workers now start as forks of one small template that shares the compiled code, so a supervisor ends up around 6 MB.
Sharing the details later today ๐
composer require tevkert/queue-prefork
php artisan queue-prefork:doctor # on your server
MIT: https://t.co/FrVZuWCSht
If you try it, reply with your before and after from queue-prefork:status. I'd love numbers from big fleets.
Running Laravel queues with queue:work or Horizon?
Every worker boots your whole app and keeps its own copy of the compiled code in memory. 8 workers, 8 copies.
I made them share one: โ70% memory for queue:work, โ81% for Horizon. Drop-in, no code changes.