Timeouts when using the Upload Media to Twitter step

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

Raymond Camden : I’m continuing to get timeouts with the upload to twitter step. for a file that is 850KB or so, should it really take over 120 seconds to upload?

Pravin Savkar : - can you add me as a collaborator to the workflow? You can just add the user pravin.

Raymond Camden : done

Raymond Camden : ive increased the timeout on my workflow and it seemed ot help, but it seems weird for the media upload to go so low

Raymond Camden : slow even

Raymond Camden : Just had another timeout for an image that’s 371k. That’s big for a web image, but still pretty tiny.

Pravin Savkar : sorry for the delay! i see the timeouts and I can repro. i’ll raise this with the team and get back to you.

Raymond Camden : id be interested in knowing the details when you get a fix. just curious.

Dylan Sather (Pipedream) : just looked into this and the way the step is written, I’m not surprised it’s slow. I’m going to start by increasing the chunk size, it’s pretty low so I think that’ll help a lot. One moment

Dylan Sather (Pipedream) : You might remember Twitter has this interesting API that requires us to split the image file and send chunks of it at a time. Previously I’d been sending 1k chunks at a time, now I’m sending 10k chunks (anything above that yielded an error for me). I’m seeing uploads process much quicker now.

Currently we’re also uploading chunks one at a time. I’m also going to try parallelizing these, to see if Twitter will allow that.

Raymond Camden : Cool I’ll look at my executions tomorrow!

Dylan Sather (Pipedream) : I was able to parallelize requests, current action is ~25x faster than the original. Note that you’ll need to add the newest version of the Upload Media to Twitter action to your workflow to utilize this new code.

Raymond Camden : You know - that would be a good simple blog post too. Thank you!

Dylan Sather (Pipedream) : agreed!

Raymond Camden : Query - if we weren’t having this conversation - how would you imagine users finding out about a significant update like this - one where you would strongly recommend users to update their steps?

Dylan Sather (Pipedream) : definitely not a solved problem. Some thoughts, let me know how these hit you:

• Users could subscribe to async (email) updates when an action they’re using in an active workflow is updated
• We’ve considered adding a notifications widget in the product, so when you log in you’d see that you have notifications pending, and we could surface that here
• Show inline with a :exclamation: or something next to the step, in the workflow, prompting you to upgrade

Raymond Camden : Honestly I like all three. For 1 I’d make it generic though as a setting: Inform me of critical updates to actions in my workflow.

Raymond Camden : Ie don’t make me “subscribe” for individual steps

Dylan Sather (Pipedream) : For sure

Raymond Camden : First test - a workflow that takes roughly 90-120 seconds (or times out) ran in 6seconds