Understanding Cost Estimate for Google Cloud Platform MicroServices Architecture Design

♀尐吖头ヾ 提交于 2019-12-06 02:45:27

The full outline of App Engine instance handling is available at https://cloud.google.com/appengine/docs/python/how-instances-are-managed . In short, your best bet is to enable automatic scaling and set

max_idle_instances = 0

in your app.yaml.

That means that your app will autoscale to handle traffic as needed and shut down the instances afterwards. Also

When settling back to normal levels after a load spike, the number of idle instances can temporarily exceed your specified maximum. However, you will not be charged for more instances than the maximum number you've specified.

Later - when load time becomes more important you can set min_idle_instances to a more suitable number - this allows for responsive apps.

am concerned that my costs will be uncontrollable after I build it

You should be aware that automatically scalable GAE apps always have cost components dependent on the external user request patterns which are not controllable.

For example, in the standard GAE env, the way those 200 requests/day are distributed matters significantly:

  • if they are evenly distributed they will come in less than 15 min apart - the minimum billed time per instance lifetime, so the respective service will be billed for minimum 24 instance hours per day (very close to the daily 28 free instance-hours/day for billed apps, only a single-service app using the smallest instance class can fit in it).
  • if they are all received within a 15 minutes interval the service will be billed for 0.5 instance hours daily (which can easily fit in the free daily quota even with multiple services and/or with more powerfull instance classes).

The actual scalability configuration of each service can matter as well. See, for example,

The only way to keep costs under strict control is via the daily budget configuration (but hitting that limit means your app's functionality will be temporarily crippled).

All other usage-based costs being equal due to the functionality being performed you have some (potentially significant) control over costs via:

  • the GAE environment type selected for each service:

  • the number of services: you could start with fewer services by combining their functionalities (you can still keep them modularized for later split). The expected initial load you describe can easily fit within the free daily budget with just a single standard env service.

Once the app usage picks up and the free daily quotas percentage in the total costs become neglijible you can gradually split the app into multiple services as needed. In general this can be a relatively simple task if the app is properly modularized.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!