Cloud Function usage and billing

ammar_hanif_0-1690985768990.png

Hi everyone,

Refer to the above attached image, can someone please answer my below queries.

1- How am I able to make 871 requests in a single day? I only have 3 functions, for which I'm only using single function that is triggered only on hitting HTTP request (means only a few couple requests I make while testing cloud function 20 ~ 30 requests).

2- Under the billing section I was looking that first 2M Invocations per month are free. Is the invocations and requests the same thing?

3- Refer to the image below, when I dive into the cloud API details, I see the breakdown of the methods and their cumulative requests. What are these methods precisely? Since I was hoping to be charged only when I hit HTTP and thus trigger the cloud function.

ammar_hanif_2-1690986204712.png

 

 

Appreciate the usual community support 😊

1 2 284
2 REPLIES 2

Hello @ammar_hanif,

Below are answers to your queries:

1. Requests for the Cloud Function API means an incoming event or trigger that uses the API, this means that Cloud Function API is triggered 871 times. Read more about Cloud Function Triggers. The reason you have all these requests is because there are background method requests made while the cloud function is running. It could also be because of HTTP Triggers or Event Triggers such as Pub/Sub Triggers, or Cloud Storage triggers. 

2. Invocations are charged regardless of the source. This includes HTTP function invocations from HTTP requests, events forwarded to background or CloudEvent functions, and invocations resulting from the call API. In HTTP Triggers, it enables it to run in response to HTTP requests. HTTP triggers support the GET, POST, PUT, DELETE, and OPTIONS request methods. So these methods are also part of the invocation count.

3. These methods may be called behind the scenes because of your Cloud Functions. Read more about Cloud Functions API. It Manages lightweight user-provided functions executed in response to events.

You can also contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!

Hello @Marramirez ,

Refer to your response above, have I understood it correct that my total requests/ invocations charged would be the total of HTTP/ Events triggers made explicitly plus any additional background methods requests triggered by itself?

Furthermore, if that's the case how am I am to able forecast the expected invocation utilization and thus billing? Since initially I was hoping that only the explicit HTTP/ Event triggers would be charged (not the additional background method requests). As I could only forecast the expected requested hit based on my users and activity, how am I able to forecast the different background method requests called and charged in background?