Suppose that we have a legacy LAMP application and we do not know *anything* about the programming code, or it is very difficult to change the programming code.
We have a single server with probably Cloudflare in front of it:
Now suppose that the web traffic increased and the server can not handle it.
An easy option is to use faster server, but let's' suppose that a faster server is not available or it is very expensive.
In this case we can setup one more server for MySQL only.
For even better performance, we can do migration from MySQL to TokuDB and optionally we could install MySQL database on RAM disk.
Now suppose that the web traffic increased more and the server can not handle it again.
If the problem is in MySQL, we can not scale any more in the future, because MySQL replication will need changes in the programming code.
However, if the slowdown is in the PHP part of the system, we could duplicate the web server.
To work correctly, we will need to install a File Server (NFS) that holds web site data.
Another problem will be PHP sessions. For them we need to install Redis or Memcached. Sessions inside MySQL will work, too.
We can install File Server and Redis on first web server.
With this method the traffic will be evenly distributed and the first web server will take more load, but the difference in the overall performance between servers will not be noticeable.
For load balancer we can use Cloudflare or DNS.
Now suppose that the web traffic increased more...
...we can add more web servers, but at some point of time first web server will not be able to handle the demand.
At that point, we can install Redis and File Server on a separate server. We can also put our own load balancer there as well.
This is probably the last optimization we can do, without changing the program code.
Using a setup like this, it can buy us lots of time, until we can develop new system or fix the legacy code.