Why would the same exact Firebase Function take 10x as long to run using a schedule/onRun trigger than a HTTP onRequest trigger?

25 views
Skip to first unread message

Mike CS

unread,
May 1, 2020, 9:03:25 AM5/1/20
to Google App Engine
I have a 2 identical Firebase functions that batch write data to Firestore. One is wrapped in a scheduled/onRun trigger, and the other is a HTTP onRequest trigger. Other than that, both functions are exactly the same, copy & pasted.

They have the same amount of memory and timeout as well.

When invoking the http trigger, the function runs through and completes in about 30 seconds.

When invoking the scheduled onRun trigger, the function takes 5+ minutes to complete.

I have tried console logging every single step of the process and there is no difference in anything other than the scheduled function taking 10x longer.

Is there something different about the runtimes that is not documented or something?

Mike CS

unread,
May 1, 2020, 9:03:32 AM5/1/20
to Google App Engine
I have 2 identical Firebase functions that batch write data to Firestore. One is wrapped in a scheduled/onRun trigger, and the other is a HTTP onRequest trigger. Other than that, both functions are exactly the same, copy & pasted.

George (Cloud Platform Support)

unread,
May 1, 2020, 3:17:38 PM5/1/20
to Google App Engine
Hello Mike, 

To establish the root cause of this wide difference in execution time between your 2 functions we need details such as project ID, function names, and even a sample of your function's code in view of reproductions. All this private information cannot be disclosed in a publicly visible thread as this one. If you think there is a possible error in Firebase, you should open a private issue in the Public Issue Tracker, setting it as private, to protect your private information. 

This discussion group is oriented more towards general opinions, trends, and issues of general nature touching App Engine. For Firebase function behavior, you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help. 
Reply all
Reply to author
Forward
0 new messages