I am trying to do load balancing between two geo-separated servers and I am thinking that instead of replicating the whole package (i.e., MySQL data/PHP/HTML/Images) to both servers, I would just generate static pages (based on content from MySQL) first then replicate those static pages instead. So that Server A and Server B would just serve static pages without any MySQL connection.
Initially I think this would reduce load on both servers since MySQL is no longer used when viewing the pages. My question now is, are there any disadvantages that I should be aware of in this method?
It depends on the update rate of your data, and whether you care of some people might see stale versions of it for a time.
You’d have to do real performance testing to figure this out for sure, but if you are often updating the MySQL database, it might not be worth generating new pages on every update and pushing them to the different servers. However, if you’re only updating the database once in a while, you may get some significant savings.
You also have to think about stale data either way you go. If the database gets updated on one server but not on the other right away, is it OK if some visitors see the stale data while the change propagates?