A PoC for Geographically Distributed WordPress Deployment

24/08/2023

Listen "A PoC for Geographically Distributed WordPress Deployment"

Episode Synopsis

This site is hosted in a single AWS Lightsail instance in Japan West region, it has perfect performance when visiting from near by regions, however it has poor performance if visiting from another continent.
- Poor TTFB and LCP from US East and Europe
- Core Web Vital fails because of slow LCP, which impacts SEO performance.
I've been using WordPress to run this site for almost 10 years. WordPress have been a very successful software in blogging, CMS and even e-commerce. Comparing with static solutions, it takes more effort to optimize its performance, because of its "dynamic" nature.
I've done a lot of performance tuning for this site, and it already archived ~150 ms TTFB from nearby cities, it's not possible to optimize any further from the server side. It's also very difficult to optimize the time that data travels between visitors and the server, since the speed of the packet is limited by the speed of light, and we don't have the control to the routing of the packets.
One solution that came up to my mind is to add more origin servers and make them distributed all over the world. The visitors will hit the nearest server to eliminate the latency, it also makes the site HA by rerouting the visitors to the working site in case one of the servers is down. While there are some managed WordPress hostings that provide this feature, but these services are very expensive.
I decided to conduct a proof of concept for this idea. The goals are:
-