I am running a queue worker that connects to six MQs. When it is brought up, it consumes 25MB of RAM. That is with zero jobs on the queue, i.e. the worker is in a sleep state. I use Larvel for all of my projects, this particular project is purely built for the queue worker (i.e. a microservice with no web access).
I would like to reduce the memory footprint, but more importantly I would like to know where the memory is being consumed. I am using PHP 7.1 so now that xhprof no longer profiles memory I have to figure out an alternative.
I know that Lumen is meant to consume less memory, and it seems at least that Lumen is a subset of Laravel. Is it possible to "turn off" parts of my Laravel app so that it mimics Lumen? I tried commenting out lines from the config/app.php $providers
array, but there does not seem to be a big difference in memory consumption (~1MB by my measure).
tl;dr; how to "tweak" the Laravel memory footprint? how to turn Laravel into Lumen?
Thanks
EDIT: Pics or it didn't happen. AFAIK the RES column is in kilobytes, so ~39MB of memory.
Have you checked your php.ini and turned off any extensions you don't require for your worker & rest of codebase.
You could create a custom php.ini for this worker and supply it via the command line arguments
php -c queue_php.ini artisan queue:work.
Don't forget that the memory footprint you're seeing there is for all of that PHP execution so that includes the JIT Compiler and any extensions loaded and whatever they load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With