I’m in two minds at the moment and can’t decide on the best approach for developing a PHP application where it’s main purpose is scheduling tasks. I’m currently re-factoring a previous version which utilized the Symfony Process component for running/tracking processes in parallel, which under the hood uses the PHP exec function.
The only problem I see currently with this implementation, is the separate processes will run through CLI and not be able to take advantage of op-code cache, with the likes of OPcache, APC etc.
For this reason, I’m almost favouring the CURL solution. I would be interested in knowing how these different approaches compared, when you incorporate load balancing on the server using Nginx and having OPcache enabled. It also allows for (I won’t say better, but) easier scalability. I’d like to hear your thoughts and whether your comment about curl not being a serious alternative still stands.
Also, I’m aware that there’s better ways of carrying out this type of work, Gearman, ZeroMQ etc. However I’m tied to a Windows operating system for this project which hasn’t made it easy.