I have a php script that I run multiple threads of 24hrs a day doing background processing. Originally I would call the php script using apache with mod_php, resulting in a lot of http processes using around 200mb of ram.
I then changed my setup to call php and run the script via the command line, and I also niced command line php to the lowest cpu priority.
I am now trying to improve memory usage. Would it be possible to run php-fpm, and call that directly? I would also run php-fpm at the lowest cpu priority, and was hoping that would reduce memory usage because if I understand it correctly php-fpm would have multiple threads sharing the php memory, unlike apache prefork mod_php.