Speeding up PHP CLI applications using OpCache
I run a few PHP based applications which require background jobs, and I use the usual crond
via crontab
to run the jobs. PHP has an excellent feature – OpCache which can cache the compiled code in memory to speed up the web applications, where typically the PHP-FPM process is a long running process so the compiled code can be fetched on next request. But with CLI applications there is no shared state or memory to store the compiled code.