Firebase database triggers execution delay

I am using Firebase cloud functions to fire triggers when a client adds something to the database, but it looks like these triggers take a long time to execute.

For example, I have a trigger that adds a creation date to a message whenever a message is added to the database, and it takes 10 seconds to complete. Also, I have more triggers that take even longer.

Is there a "best practice" I am missing? Am I doing something wrong?

+3


source to share


1 answer


I found that the reason cloud functions sometimes take a while to respond is because they have a "warm-up" period, which means that the first time the cloud function is called, it starts to warm up, t be fully responsive while will not get warm.

Once warmed up, it will be as responsive as you would expect.



The reason for this behavior is resource balancing. If you don't use a feature for some time, it will disable and clean up resources so that other features are more responsive.

+3


source







All Articles