简体   繁体   English

Google Cloud node.js灵活的环境

[英]Google Cloud node.js flexible environment

I deployed a node.js app as a learning tool and noticed that I'm getting billed for the project (around a $1/day). 我部署了一个node.js应用程序作为学习工具,并注意到我正在为该项目收费(大约每天1美元)。 I know node.js on Google Cloud uses Compute Engine to run the vm's, but they say the flexible environment has all the advantages of the AppEngine platform, but it seems the instances don't auto stop and start to reduce billing when not in use. 我知道Google Cloud上的node.js使用Compute Engine来运行虚拟机,但是他们说灵活的环境具有AppEngine平台的所有优势,但似乎实例不会自动停止并在不使用时开始减少计费。

I have java project that's been running on App Engine for years and I've never been billed anything, i'm guessing that's because the instances are shutdown automatically when not in use. 我有几年来一直在App Engine上运行的java项目,我从来没有收到任何费用,我猜这是因为实例在不使用时会自动关闭。 So my questions are; 所以我的问题是;

Is there a way to configure the flexible environment to mimic the standard environment to reduce the operating costs? 有没有办法配置灵活的环境来模仿标准环境以降低运营成本?

Am I miss-using something with the flexible environment? 我错过了在灵活环境中使用的东西吗?

According to Google App Engine Documentation , 根据Google App Engine文档

Instances within the standard environment have access to a daily limit of resource usage that is provided at no charge defined by a set of quotas... 标准环境中的实例可以访问由一组配额定义的免费资源使用的每日限制...

Instances within the flexible environment are charged the cost of the underlying Google Compute Engine Virtual Machines. 灵活环境中的实例将收取基础Google Compute Engine虚拟机的成本。

According to this article , 根据这篇文章

Currently, the Flexible Environment needs at least one instance running to serve traffic and there is no free tier. 目前,灵活环境至少需要一个运行实例来提供流量,并且没有免费套餐。

This means that at any one time, you have at least one instance running, if you're using a Flexible VM. 这意味着,如果您使用的是灵活虚拟机,则在任何时候都至少运行一个实例。 That should explain the billing. 这应该解释计费。

Please note that by default appengine launches two g1-small instances. 请注意,默认情况下,appengine会启动两个g1-small实例。 Depending on your application needs, this may be an over-kill. 根据您的应用需求,这可能是过度杀戮。 You should configure the compute resource settings in your app.yaml to the appropriate sizes of RAM, disk size and CPU, so as to save costs. 您应该将app.yaml 的计算资源设置配置为适当大小的RAM,磁盘大小和CPU,以节省成本。 You may also want to specify the min_num_instances as 1 in your service scaling settings . 您可能还希望在服务缩放设置 min_num_instances指定为1。

I had the same problem. 我有同样的问题。 You can try to use Google's pricing calculator to figure out which configuration you need and how to minimize the cost of your application. 您可以尝试使用Google的定价计算器来确定您需要的配置以及如何最大限度地降低应用程序的成本。

According to the calculator, the minimal cost for a flexible environment app is a little less than 40$ per month, There is nothing to do about it right now. 根据计算器,灵活环境应用程序的最低成本每月不到40美元,现在没有任何关系。

I eventually moved to Heruko because of that. 因为这个原因,我最终搬到了Heruko。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM