3 ms·
Does this implement the “traffic pausing” pattern? That’s where you have a proxy which effectively pauses traffic for a few seconds - incoming requests appear
by simonw 2y ago
Does this implement the “traffic pausing” pattern?
That’s where you have a proxy which effectively pauses traffic for a few seconds - incoming requests appear to take a couple of seconds longer than usual, but are still completed after that short delay.
During those couple of seconds you can run a blocking infrastructure change - could be a small database migration, or could be something a little more complex as long as you can get it finished in less than about 5 seconds.
- ignoramous 2y agotbh, sounds like "living dangerously" pattern to me.
- francislavoie 2y agoNot really, works quite well as long as your proxy/server have enough memory to hold the requests for a little while. As long as you're not serving near your max load all the time, it's a breeze.
- tinco 2y agoHave you seen that done in production? It sounds really dangerous, I've worked for an app server company for years and this is the first I've heard of this pattern. I'd wave it away if I didn't notice in your bio that you co-created Django so you've probably seen your fair share of deployments.
- written-beyond 2y agoJust asking, isn't this what every serverless platform uses while it spins up an instance? Like it's why cold starts are a topic at all, or else the first few requests would just fail until the instance spun up to handle the request.
- tinco 2y agoYeah definitely. The dangerous part is having migrations or some other preparatory task be a part of it. When you're mixing concerns like that, you open yourself up to more complex failure cases and a larger surface area for bugs to arise. I feel that when you've grown to the size where zero downtime deploys are so important you'd do custom code just to enable them, it would be best to just invest in industry best practices and do backwards compatible deploys.
- simonw 2y agoI first heard about it from Braintree. https://simonwillison.net/2011/Jun/30/braintree/ https://simonwillison.net/2011/Jun/30/braintree/
- deleted 2y ago[deleted]
- francislavoie 2y agoCaddy does this! (As you know, I think. I feel I remember we discussed this some time ago)
- m_sahaf 2y agoYep, it was Simon: https://til.simonwillison.net/caddy/pause-retry-traffic https://til.simonwillison.net/caddy/pause-retry-traffic