Yeah, baselining is always the best starting point when it come to hardware & software.
Even if its just to baseline your current setup so that you can see what effect each upgrade has.
Try signing up to a trial monitoring service like Site24x7 (pretty much full LAMP monitoring for free for 30 days) and then letting it run for a week. It will give you a reasonable idea of actual system performance (DB, Apache, PHP, RAM HDD etc). This helps with tweaking and optimising things like memcached, MySQL, Apache & PHP.
From personal experience, I have found that:
The obvious hardware upgrade is HDD to SSD (if not already done).
Next is RAM (16-32Gb to enable expand use of Memcached, Opcache, Apache threads, increased DB buffers etc). Generally, a faster CPU on a LAMP setup provides limited loading-speed improvement. 90% of the time the speed of loading is limited by the HDD/RAM anyway. But you can see that from the monitoring reports.
For the actual LAMP stack, the biggest speed gains are gained from optimising the WP code.
Make sure that there are no long-running DB queries or joins without index’s (monitoring should help reveal this). Plugins are normally the biggest culprits, as they are often badly written or not coded with performance in mind.
Next, check that your PHP version is the highest supported by WP. For example, PHP 8.0 is roughly 18% faster than PHP 7.4 and 50% faster than PHP 7.0 That’s a nice easy speed gain, assuming your WP setup can use the latest PHP versions.
Next, see if MySQL database been fully optimised?
(Again, monitoring will help you understand the DB performance)
Apache/Nginx work pretty well out of the box, so unless you really know what you are doing, you aren’t going to gain much speed improvement there.
While doing all this, make use of tools like Google Lighthouse to measure real-world website performance. It may be that, unless your servers are overloaded, the difference is so small that it hardly makes it worth the effort.
regards
Sam Smith
designboys.co.za