Venktaish
Venktaish

Reputation: 141

Firebase functions invocation/executaion limit is a pain

I am using firebase hosting and functions together to convert PDF TO IMAGE.

For that i wrote a function which takes the file and converts the pdf upload it storage, generates a signedURL and returns it to the user.

In hosting i wrote a rewrite which redirects request from /ecc to ecc function.

Setup worked Well. Website is up and running.

But when i asked a small group of 100 people to use it.

Then firebase functions started throwing err 429 which is too many requests.

Is there any limit on executing functions in 100 Seconds ?

This is the log:

Error: quota exceeded (Quota exceeded for quota group 'CPUMilliSecondsNonbillable' and limit 'CPU allocation in function invocations per 100 seconds' of service 'cloudfunctions.googleapis.com' for consumer 'project_number:992192007775'.); to increase quotas, enable billing in your project at https://console.cloud.google.com/billing?project=myProject. Function cannot be executed. {"serviceContext":{"service":"ecc"},"context":{"reportLocation":{"functionName":"ecc","lineNumber":0,"filePath":"file"}}}

And in Firebase pricing it says that 125K invocation per month is free but with 40K GB and CPU seconds.

So if i have a function with execution time of 10 seconds i can call only 4000 functions per month ? and with that 16 calls per 100 seconds Limit. where are other 121K function?

Updated Information from Quotas

It's really a head banging thing to understand the limits here this is the main quota page

QUOTA PAGE

FUNCTION EXECUTION TIME IS 10 SECOND. AND I'LL CALCULATE THINGS ON THAT.

Now with all that in mind i can say i can execute 50 functions per 100 seconds.

What my error was QUOTA EXCEEDED 'CPU allocation in function invocations per 100 seconds'

but as per the QUOTA the CPU ALLOC IN FUN INV PER 100 SECOND is 100K !!! ??

How it even exceeded the limit ?

as i said my function execution is about 5-10 seconds and with the invocation limit, maximum seconds would be 500.

What is going on ?, Why QUOTA is exceeding ?
what's the difference beetwen Read and Invoking a function ?

Upvotes: 1

Views: 2261

Answers (1)

Methkal Khalawi
Methkal Khalawi

Reputation: 2477

From the error it seems that you have exceeded the quota for Firebase Functions (CPU) per month and as you are using free tier then it's only 40K per month.

Using Firebase Functions in Free tier (Spark) is very limited and it's only for Node 8.

To resolve this you need to upgrade to Blaze plan (pay as you go). which also has free tier:

CPU --> Free up to 200K/month

Please, read more about this here

Upvotes: 1

Related Questions