从 Google Cloud Function 写入临时文件 [英] Write temporary files from Google Cloud Function

查看:20
本文介绍了从 Google Cloud Function 写入临时文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以从 Google Cloud Function 写入容器的本地文件系统吗?AWS Lambda 允许写入/tmp:

Can I write to the container's local filesystem from a Google Cloud Function? AWS Lambda allows writing to /tmp:

问:如果我的 AWS Lambda 函数需要磁盘上的暂存空间怎么办?
每个 Lambda 函数在它自己的/tmp 目录.

Q: What if I need scratch space on disk for my AWS Lambda function?
Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory.

在 GCF 中有没有等价的东西?

Is there something equivalent in GCF?

推荐答案

是的,/tmp 是内存挂载.来自 https://cloud.google.com/functions/docs/concepts/exec#文件系统:

Yes, /tmp is an in-memory mount. From https://cloud.google.com/functions/docs/concepts/exec#file_system:

文件系统唯一可写的部分是 /tmp 目录,您可以使用它在函数实例中存储临时文件.这是一个本地磁盘挂载点,称为tmpfs"卷,其中写入该卷的数据存储在内存中.请注意,它会消耗为函数配置的内存资源.

File system

The only writeable part of the filesystem is the /tmp directory, which you can use to store temporary files in a function instance. 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.

这篇关于从 Google Cloud Function 写入临时文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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