Scaling Up My Site To 9 Instances Around The World
I recently scaled up my site to 9 instances in regions all over the world to make it faster. Open the headers of any request to my server and check the `x-fly-region` header to see which instance is serving your requests. Try it out and see the difference!
Kent C. Dodds ๐
Improving the world with quality software ยท Husband, Father, Latter-day Saint, Teacher ยท https://t.co/pPQmnZS6rR, https://t.co/NYn5aJVGve, https://t.co/U5KafpJTZp
-
I had forgotten that a while back I scaled my site down to a single instance to test some stuff out. I've now scaled it up to 9 instances in regions all over the world so hopefully it's noticeably faster if you're outside the US :)
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
Feel free to try it out and see which instance is serving your requests! Open the headers of any request to my server and check the `x-fly-region` header.
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023
For me, it's sjc (San Jose) ๐ pic.twitter.com/3k5gMjrgzF -
And don't miss the real-world server timings I attach to requests as well. Kinda interesting to see how long everything takes. pic.twitter.com/kdrvOzC15C
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023
-
Here's a great page to test ๐ https://t.co/rZ7LbuCj5X
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
Oh, would you look at that! This workshop's actually got two scheduled events you can sign up for right now! ๐ pic.twitter.com/OrYyrgWyPt
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
I know, it's not sub 100ms responses most of the time, but it's pretty darn close and when you consider the amount of stuff my site does on every page visit it's pretty remarkable.
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
Doing what my site does with a serverless architecture would be extremely difficult (in fact, some of it would be impossible).
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
And keep in mind that HTTP-level caching (and therefore SSG) wouldn't work with my requirements because every page load serves unique results. So my server's doing a fair bit of work here.
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023
The fact that I can get you a response in feels-like-instant time is pretty sick. -
I like to compare my own site to Amazon's because we're both serving very dynamic content, but for Amazon, a slower experience costs millions and they have the resources to pour into that whereas for me it... eh... isn't quite that way ๐
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023 -
So if I can be faster than Amazon, I feel like I'm in a good spot... And... I'm in a good spot. ๐
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023
Here's how we each perform on a low-end device in India: https://t.co/iMxkuMusfp pic.twitter.com/YgaKpxzhDW -
To be clear. I'm sure there are spots I could optimize further! But I'm pretty pleased with where it's at.
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023
And I'd love to throw bun at this one day too ๐๐จ -
*in fact, not impossible: https://t.co/z2Xxcso7f9
— Kent C. Dodds ๐ (@kentcdodds) April 5, 2023