-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Queues. "memory" parameter is not working as expected. #56077
Copy link
Copy link
Closed
Description
Laravel Version
10.48.28
PHP Version
8.2
Database Driver & Version
No response
Description
Hello,
I had to implement my own internal queue handler to replace queue:work. In my handler, I use ini_set to set a memory limit. However, I encountered an issue where some tasks stopped executing due to memory restrictions. At the same time, the configured memory limit did not change. For queue:work I used the --memory=512 parameter.
As a result, I decided to check the logs in Kibana (where I also record memory_get_peak_usage), and it turned out that many tasks exceeded the specified limits by a significant margin.
I would be interested to know the purpose of the --memory parameter in Laravel's queue handler. I assumed it was a memory limit for the tasks, wasn't it?
Steps To Reproduce
- Setup simple job, with memory overloading. For example:
while(true) {
$arr[] = mt_rand();
}- Set this job into queue
- Run queue handler with memory parameter. For example:
php artisan queue:work --queue=<your-queue-name> --memory=50 - See how your memory overloaded
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.