Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
Firebase Callable Functions cold-start

I want to use the Firebase callable functions to run checks on the back-end but I am worried about the cold-start. For instance, I want to check if a user has sufficient credits to download a certain product but I would like to avoid users waiting 10 seconds or more before this promise gets resolved or rejected, and running these checks from the front-end is no option as anyone could bypass them.

Is there a way to do provisioning for a selected group of callable functions on Firebase so that the whole experience doesn't feel slow and frustrating for users? Many users if they have to wait 10 seconds (even if its just for the first time) might give up using this service I want to sell...

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Is there a way to do provisioning for a selected group of callable functions on Firebase?

Yes, as explained in the doc, you can set a minimum number of instances for a given Cloud Function with the runWith parameter, as shown below:

exports.myCallableCloudFunction = functions
    .runWith({
      // Keep 1 instance warm
      minInstances: 1,
    })
    .https.onCall((data, context) => {
      // Cloud Function code
    });

You can have more than one instance warm by passing the desired value, e.g. minInstances: 3.

Note that "a minimum number of instances kept running incur billing costs at idle rates. Typically, to keep one idle function instance warm costs less than $6.00 a month" (excerpt from the doc).


Note also that you need to configure each Cloud Function with this option, AFAIK you cannot apply it to a group of Cloud Functions.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda