will Cloud Function affect Firebase Storage bandwidth usage?

我与影子孤独终老i 提交于 2020-12-19 01:39:20

问题


I am trying to figure out why firebase storage usage is far above my expectation

I only have few photo files in my Firebase storage, just around 75 photos, 100kb for each photo. but my bytes stored and object counts is way above my expectation as you can see in the image above. in this case, maybe I find the answer from the documentation in here

When you deploy your function's source code to Cloud Functions, that source is stored in a Cloud Storage bucket. Cloud Build then automatically builds your code into a container image and pushes that image to Container Registry. Cloud Functions accesses this image when it needs to run the container to execute your function.

The process of building the image is entirely automatic and requires no direct input from you

it is probably because I create a lot of cloud function. thats why the bytes stored and object count in my Firebase Storage is big

now I need to know why storage bandwidth is up to 20.2 GB in a month. I am still developing my app, the user is just me. I don't think I will hit 20.2 GB in a month, because in my Android app, I use cache when showing the image.

I am suspicious, the reason why my storage bandwidth usage is too high is because of cloud function. in August, I perform a lot of firebase deploy to my cloud function. will Cloud Function affect Firebase Storage bandwidth usage ?

I am in Indonesia, my Firebase Storage and Firestore are located in asia-southeast2, but my Cloud Function is located in asia-east2. my cloud function perform some operation to my firestore and images in storage. but still I don't think it will hit 20.2 GB per month

as you can see from the image above, the bandwidth usage is separated into 3 different parts

  1. asia.artifacts.projectID.appspot.com
  2. gcf-sources-5900904-asia-east2
  3. projectID.appspot.com

the asia.artifacts.projectID.appspot.com seems way above the other, it is up to 4.3 GB

thats some information of my problem. so I need to know, will cloud function deployment/operation affect my Firebase Storage Bandwidth usage ?

I need to understand why this is happened, because I am worried that I will have unexpected cost if a lot of users use my app.


回答1:


The part of the documentation you quoted that's relevant here is:

Cloud Functions accesses this image when it needs to run the container to execute your function.

The built images are being accessed by Cloud Functions in order to run your code that's built into the image. Although the documentation doesn't specify, I would guess that every cold start of a function requires a download of the image from the artifacts bucket. This would explain the usage on that bucket.



来源:https://stackoverflow.com/questions/63697282/will-cloud-function-affect-firebase-storage-bandwidth-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!