PHP performance improvement for 32GB RAM

Solution 1:

As we have no idea what your program does, it's impossible to say if adding resources will improve its performance.

Whatever you do, beware premature optimization. Sampling resources usage during its run (e.g. with vmstat) will yield if your programm is resource starved. Establish a baseline, add resources and verify that your program actually benefitted from adding them.

If there is no bottleneck, adding resources will not make your program run faster. Running it on a newer CPU model might speed it up a little.

As you've stated that your program is invoked by cron, I'm assuming that you are running standalone software (with perhaps the occasional call to a web application). Thus making use of more CPU cores is something that your code must be prepared for, using some kind of parallel operation paradigm like threading, forking, etc.

If we're talking web application only, and your cron job is a glorified wget call, check if you are using php-fpm and the PHP opcache module.