Firebase cloud function [ Error: memory limit exceeded. Function invocation was interrupted.] on youtube video upload

后端 未结 2 1355
死守一世寂寞
死守一世寂寞 2021-01-24 14:22

I was trying to upload videos to youtube using the firebase cloud function.

What I need is when a user uploads a video to firebase cloud storage, functions.storage.objec

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 14:34

    The only writeable part of the filesystem in Cloud Functions is the /tmp directory. As per the documentation here:

    This is a local disk mount point known as a "tmpfs" volume in which data written to the volume is stored in memory. Note that it will consume memory resources provisioned for the function.

    This is why you hit the memory limit with bigger files.

    Your options are:

    • Allocate more memory to your function (currently up to 2 GB)
    • Execute the upload from an environment where you can write to filesystem. For example, your Cloud Function could call an App Engine Flexible service to execute the upload.

提交回复
热议问题