Need advice on how to gracefully handle server load & spikes for WordPress site.
I have two $5 droplets currently. One is hosting the WordPress webapp and the other is the corresponding MariaDB database. When starting out a free load test from loadimpact.com, the site is operating fine, but the site gets slower as the test continues to ramp towards its 25VUs.
By the time it gets to around 20, its pretty much inaccessible and I can see the
top shows a ton of php-fpm's spun up. It takes about another couple minutes until they're done executing before the site returns to normal.
I know I can increase the droplet size or even start load balancing with replication, but what do I do about unanticipated site spikes that are not planned through the vertical scaling techniques?
This is a Ubuntu 18.04 setup running nginx/apache, there's Redis caching, Cloudflare caching, and the basic site caching on.