Requests hang for a long time while adding a new region

I’m playing around with adding regions to a test app. I deployed a static site app in ewr, and tried accessing it from a singapore linode. Requests take about 250ms. Then I flyctl regions add sin, and do another request from the linode–this time the request takes about 20 seconds, presumable because the new region is booting. I wait a little while, and now requests take 25ms, so obviously the new region is active.

The super long request is a problem though. Shouldn’t requests not be routed to a region that’s not ready?

This is related to deploy request slowness. Adding a region triggers a full release cycle, just like when you deploy a new image.

Service discovery has gotten slow as we’ve scaled. We’re in the process of rebuilding it, because this stuff should be much faster. So bear with us for a few days.

You can work around this if you’re changing regions frequently. If you scale the app up with flyctl scale count 3, then flyctl regions add <code>, it should keep older instances alive long enough to prevent slow requests. You can then scale back down to 1. It’s not ideal, but it’ll work!