【问题标题】:Is it possible to use different implementation of Python, except of standard one in Gogle Cloud Functions?除了 Google Cloud Functions 中的标准实现之外,是否可以使用不同的 Python 实现?
【发布时间】:2025-12-18 00:10:01
【问题描述】:

我是 Google Cloud Functions 的新手。我想编写一个小但执行密集的应用程序。我研究了doc,目前还不清楚在部署到 Google Cloud Functions 时是否可以使用 PyPy 或 CPython。

【问题讨论】:

标签: python-3.x google-cloud-platform google-cloud-functions cpython pypy


【解决方案1】:

在函数中,你不能自定义运行时,it is standard 到服务。

如果您想对您的环境进行更多控制,请选择 Cloud Run,无服务器但基于容器,因此您可以在 Dockerbuild 中做您想做的事情。

此外,您始终拥有 1 个专用于进程的 vCPU,并具有可自定义数量的内存。使用 Cloud Functions,如果您想拥有 CPU 的全部功能,您必须支付 2GB 内存。最后,使用 Cloud Run,您的流程最多可能需要 15 分钟,而使用 Cloud Functions 只需 9 分钟。 如果您想了解更多信息,我wrote an article

【讨论】:

  • 它不能直接解决我的问题,但它是一个很好的解决方法!谢谢
最近更新 更多