How Can I Keep My Workflow Warm Without Burning Invocations?

This topic was automatically generated from Slack. You can find the original thread here.

I have a workflow that I am looking to keep warm so there is no spin up time when it hasn’t been invoked in awhile. I have followed the guidance here. I have it being triggered every 5 minutes. It is going in an out of staying warm. I.e. 7 runs in a row 200 ms time, then 5 where it takes 10+ seconds in a row, then back to a few in a row of 200 ms. I am trying to be conscious of burning invocations, so I would prefer not invoking it every 4 minutes or 3 minutes, but know this may be the necessary outcome. Any suggestions outside of invoking more frequently?

Hello ,

I think @U02SX7ETBFB from Pipedream team might be able to help. He’ll online in a few hours :pray:

OK sounds good. Thank you

Cold starts are definitely a hard problem to manage. AWS is responsible for managing this environment and this behavior, so the timing with cold starts aren’t within our control. We recommend warming a workflow every 5 minutes since that typically works for low-volume workflows in practice, but environments aren’t guaranteed to remain warm that long, as you’ve seen.

We’re testing a feature internally to keep workflows permanently warm, and plan to ship that soon. I’d recommend following that issue.

In the meantime, increasing the frequency of warming requests is likely to improve the probability you’ll hit a warm workflow. Again, not a guarantee, so you can balance invocations costs against your tolerance for cold starts accordingly to try to improve the latency.

all makes sense. I run into the same issue when using straight up lambda as well, so figured it was the same scenario. I’m planning on upping the frequency during “working” hours and then cutting outside.

The use case for this is that it is the install url of an app that I have. Outside of working hours, I was going to decrease the frequency to every 10 minutes. Does this make sense/have any effect? I’m thinking if I warm at 1:00, then 1:10, then someone installs at 1:12, it should theoretically be warm at that point?

Yes, in practice the env should stay warm for 2 minutes, but we’ve noticed cases where AWS shuts it down quickly