When you launch a Laravel Horizon supervisor with the --memory parameter, does this allowed memory amount is shared among all children worker processes, or it is the amount allowed for each children worker process ?
For example, using --memory=128 with 5 workers :
After digging in source code, i think i got my answer : it seems it is allowed memory per worker. (ie: for each worker).
If someone else interested : it monitors memory using PHP memory_get_usage() methods and acts accordingly.
Also an important note : ensure that your PHP memory_limit configuration options is properly set.
For example, if PHP memory_limit is 64M and Horizon worker memory option is set to 128 then if a worker process consumes more than 64M it will crash before Horizon supervisor handling and will obviously result in a timed out job.
This happened to me because i run jobs which use lot of memory _(large image size processing)_.
Most helpful comment
After digging in source code, i think i got my answer : it seems it is allowed memory per worker. (ie: for each worker).
If someone else interested : it monitors memory using PHP memory_get_usage() methods and acts accordingly.
Also an important note : ensure that your PHP
memory_limitconfiguration options is properly set.For example, if PHP
memory_limitis 64M and Horizon worker memory option is set to 128 then if a worker process consumes more than 64M it will crash before Horizon supervisor handling and will obviously result in a timed out job.This happened to me because i run jobs which use lot of memory _(large image size processing)_.