由于超出内存限制,Firebase的云功能被终止 [英] Cloud Functions for Firebase killed due to memory limit exceeded

查看:66
本文介绍了由于超出内存限制,Firebase的云功能被终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当转换相对较小的图像(2mb)时,我不断从Cloud Functions for Firebase收到零星的错误.成功完成该功能后,只需大约2000毫秒或更短的时间即可完成操作,根据Image Magick文档,我应该不会看到任何问题.

I keep getting a sporadic error from Cloud Functions for Firebase when converting a relatively small image (2mb). When successful, the function only takes about 2000ms or less to finish, and according to Image Magick documentation should I should not see any problems.

我尝试增加该命令的缓冲区大小,这在Firebase中是不允许的,并且我试图找到.spawn()的替代方法,因为这可能会因垃圾而过载并减慢运行速度.什么都行不通.

I tried increasing the buffer size for the command, which isn't allows from within Firebase, and I tried to find alternatives to .spawn() as that could be overloaded with garbage and slow things down. Nothing works.

推荐答案

[更新]正如一位评论者所建议的那样,这不再是问题,因为Firebase函数现在在重新部署时保持其设置.谢谢firebase!

[update] As one commenter suggested, this should no longer be an issue, as firebase functions now maintain their settings on re-deploy. Thanks firebase!

结果不明显或没有记录,您可以在 Google Functions控制台.您还可以增加长时间运行的功能的超时时间.它解决了内存过载的问题,并且现在一切正常.

Turns out, and this is not obvious or documented, you can increase the memory allocation to your functions in the Google Functions Console. You can also increase the timeout for long-running functions. It solved the problem with memory overload and everything is working great now.

请注意,Firebase会在部署时重置您的默认值,因此您应该记住登录到控制台并立即更新它们.我仍在寻找通过CLI更新这些设置的方法,当我找到它时会更新.

Note that Firebase will reset your default values on deploy, so you should remember to login to the console and update them right away. I am still looking around for a way to update these settings via CLI, will update when I find it.

这篇关于由于超出内存限制,Firebase的云功能被终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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