autostart
and autostop
fly-proxy features are great at keeping the costs at bay. You create the desired number of machines and let the proxy figure out how many actually need to run based on the current load.
But, there was a hitch: when the proxy stopped a machine, the other proxies didn’t know instantly (blame the speed of light!). So, they’d keep trying to send new HTTP requests or TCP connections to that machine, basically forcing it to spin right back up.
We fixed this for HTTP apps a while back by having the proxy reject the request with a “please retry” error if another machine was available. You might’ve spotted that machine was recently stopped...
message in your logs. We just couldn’t do the same thing for TCP apps… until now.
As part of our regionalization efforts (you can read more about them in our infra-log), we figured out how to handle retries and errors properly for TCP connections. With that sorted, we can now bounce a TCP connection attempt and retry it on a different machine if the first one it tried just got stopped.
So, long story short: if you’re using autostart
/autostop
for a TCP app, it should run a lot smoother now.