Cloud functions timeout management, use case advice

1,682 views
Skip to first unread message

Aurélien C

unread,
Mar 27, 2017, 6:04:04 AM3/27/17
to Firebase Google Group
Hi,

I have an issue with firebase functions timeout. My use case is video transcoding with ffmpeg : users upload a video, and the function is used to  create a HLS adaptive stream.

It could work pretty well, BUT there is a 60 seconds timeout, which makes all of this unusable. Some video will encode in less than 60 seconds, but many will not, resulting in aborted fonctions.

I see the timeout can be increased to 9 minutes in the google cloud console, which is a lot better, but might not be enough for some long videos. Also, the timeout can only be updated on the web console, not the command line :

$ gcloud beta functions deploy functionName --memory=512 --timeout=540
ERROR: (gcloud.beta.functions.deploy) one of the arguments --trigger-topic --trigger-bucket --trigger-http is required

My questions :

  1. Is the timeout a BETA thing, or is this expected to stay ? Any ETA about it (I know this a lot to ask, especially at the beginning of the beta, but anyway :) )
  2. Will the `firebase` command line enable timeout modification anytime soon ? 

If I can manage to get to 9 min timeout, I might give functions a try, otherwise it's just pointless. 

If there is a better product for my use cas in the google cloud area, I'd be happy to give it a try (I'd like to avoid keeping a server instance online all the time)

Or maybe, I can use functions for the trigger only, an then drive another server to do the encoding ? 

For example : 
  1. User uploads a file, triggers firebase storage function
  2. The function brings a compute instance up, which looks up in firebase database the job to do
  3. Server instance shuts down by itself once the encoding is done
What do you think ? Is this doable ? Advised ?

Many thanks

--
Aurelien Chivot

Kato Richardson

unread,
Apr 17, 2017, 4:47:43 PM4/17/17
to Firebase Google Group
Hi Aurélien,

I can't speak to roadmaps or future plans, but this doesn't sound like an ideal use case for Functions as it stands now.

You might have better luck running the transcoding as a separate service. Maybe you could trigger the process with a DB write or with Functions, and/or trigger a function to process the results of the transcoding, but the actual transcoding sounds problematic if it's likely to exceed a minute.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/4de36c33-18d1-4412-9f83-d4fcff1eca78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages