云功能是否会影响Firebase存储带宽使用率? [英] will Cloud Function affect Firebase Storage bandwidth usage?

查看:66
本文介绍了云功能是否会影响Firebase存储带宽使用率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清为什么Firebase存储使用量远远超出我的预期

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

我的Firebase存储中只有很少的照片文件,大约只有75张照片,每张照片100kb.但如上图所示,我存储的字节数和对象数都超出了我的期望.在这种情况下,也许我可以从此处

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

当您将函数的源代码部署到Cloud Functions时,源存储在Cloud Storage存储桶中.然后进行Cloud Build自动将您的代码构建到容器映像中,并将其推送镜像到Container Registry.当以下情况时,Cloud Functions会访问此映像:它需要运行容器来执行您的功能.

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

这可能是因为我创建了很多云功能.这就是为什么Firebase存储中存储的字节数和对象计数很大的原因

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

现在我需要知道为什么一个月内存储带宽高达20.2 GB.我仍在开发我的应用,用户就是我.我认为一个月内不会达到20.2 GB,因为在我的Android应用中,显示图像时我使用了缓存.

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.

我很怀疑,我的存储带宽使用率太高的原因是由于云功能.在八月份,我对我的云功能执行了许多 firebase deploy .云功能会影响Firebase存储带宽使用吗?

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 ?

我在印度尼西亚,我的Firebase存储和Firestore位于Asia-southeast2中,但是我的Cloud Function位于Asia-east2中.我的云端功能会对我的Firestore和存储中的图像执行一些操作.但我仍然认为它不会达到每月20.2 GB

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

asia.artifacts.projectID.appspot.com似乎位于另一个之上,它的容量高达4.3 GB

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

那是我的问题的一些信息.所以我需要知道,云功能的部署/操作会影响Firebase存储带宽的使用吗?

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.

推荐答案

我也对带宽使用感到惊讶.

I was surprised by the bandwidth usage too.

首先,Firebase更改了一些政策

First, Firebase Changed some policy

在2020年8月17日之后,每次部署操作都会对用于该功能的容器的>存储空间产生小规模费用.例如,如果您的函数通过Container Registry消耗了?> 1GB的存储空间,则每月将向您收取$ 0.026的费用.如果您的>开发过程依赖于部署功能进行测试,则可以通过在开发过程中使用Firebase Local Emulator Suite进一步将>成本降至最低.

After August 17, 2020, each deployment operation will incur small-scale charges for the >storage space used for the function's container. For example, if your functions consume ?>1GB of storage via Container Registry, you'll be billed $0.026 per month. If your >development process depends on deploying functions for testing, you can further minimize >costs by using the Firebase Local Emulator Suite during development.

因此,最合理的解释是在 npm install 期间构建云功能会产生下载 node_modules 的带宽使用情况,并占用存储空间.

So the most reasonable explanation is cloud function build during npm install generates bandwidth usage of downloading node_modules and also takes up storage.

我建议在开发过程中尽可能使用本地仿真器,但是很多情况下不可避免地要进行生产测试,真让人难过.

I would suggest use local emulator during development as much as possible, but many cases production test is inevitable, so sad.

这篇关于云功能是否会影响Firebase存储带宽使用率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆