How do I calculate how much AppEngine is costing me?

64 views
Skip to first unread message

Jasmine Sultanah

unread,
Aug 28, 2019, 12:31:57 PM8/28/19
to Google App Engine
I am using this calculator

https://cloud.google.com/products/calculator/#id=ce96468c-3b00-4dd6-920b-e838ab805265

I have a version running with these spec

runtime: go
api_version: go1
env: flexible
threadsafe: true
handlers:
  - url: .*
    script: _go_app
    secure: always
    redirect_http_response_code: '301'
automatic_scaling:
  cool_down_period: 120s
  min_num_instances: 2
  max_num_instances: 20
  cpu_utilization:
    target_utilization: 0.5
network: {}

How do I find out all the parameters to put into the appengine calculator?
my Location is london, environment is flexible. but where do i find Cores per hour, memory per hour and persistent disk?

Thanks

Diogo Almeida

unread,
Aug 28, 2019, 8:01:29 PM8/28/19
to Google App Engine
First off, note that your app.yaml settings use a deprecated version of Go (1.9). You can now use versions 1.11 or 1.12.

The documents that go over the version 1.11 and 1.12 provide more details about what the app.yaml settings mean. However, note that not all of the app.yaml settings are directly related to parameters that are used in the calculator. Moreover, there are some parameters in the calculator that are not set in the app.yaml file: region for instance.

That said, note that resources are billed on a per-second basis with a 1 minute minimum usage cost, which means that if you want to estimate the cost, you need to estimate how much of the resources your app will need to use and set it up accordingly. The cost for cores and memory per hour as well as persistent disk is explained here.

If you have any other questions about the calculator parameter I suggest you take a look at the document links provided in calculator (the ? button of each parameter).

Jasmine Sultanah

unread,
Aug 29, 2019, 12:35:57 PM8/29/19
to Google App Engine
Thanks Diogo. I have read all these links. My question is how do I find out how many cores per hour i'm using, how much memory per hour and how much persistent disk. the app is already running and I can see the dashboards in AppEngine. For example in AppEngine, my memory usage is 800MiB each minute,my instances remain at 2, CPU usage is about 5% (is this CPU usage of combined CPU for two instances?), my write Disk bytes is 50KiB a minute.  How do I translate this information into number of cores per hour, persistent disk and memory per hour. thanks

Diogo Almeida

unread,
Sep 2, 2019, 8:37:14 AM9/2/19
to Google App Engine

For the sake of the calculator, the configuration you set in App Engine is what you are charged for, regardless of the effective usage.


For CPU (cpu parameter in app.yaml), you have set the scaling factor (target_utilization) which will determine when a new instance will spin up. That will determine the moment when you can consider that a new instance will be necessary to handle the application load. So, if you set the application to run with up to 2 cores, 2 cores will be charged, regardless of how much you make use of it. If your workload fits inside 1 CPU then you should not get any more CPUs than that to avoid spending more than necessary. The unit for the cost is core per hour, so you are charged per core that is running rather than % usage of the core being effectively used. The benefit of this format is that you are guaranteed to have at least the level of resources specified.


Note that App Engine Flex is a managed Compute Engine VM, which is charged per core per minute of VM running, not by usage [1].


For memory (memory_gb), you also need to know how your application behaves in different scenarios or different memory settings. Therefore, whatever you consider appropriate and set will be charged. That said, it is a trade-off with performance and cost and you need to manually set the memory configuration so that your application has the best performance with the lowest cost you can get.


For persistent disk (disk_size_gb) you can consider the same principle as in memory usage. More details about the cpu, memory_gb and disk_size_gb settings here [2].


In regards to CPU, its use is averaged across all running instances and is used to decide when to reduce or increase the number of instances [3].


However, for the sake of monitoring the application resources usage, you can use the Stackdriver Monitoring to control for example the fraction of CPU utilization for all cores on a single App Engine flexible instance (flex/instance/cpu/utilization) and the total memory used by running instances (system/memory/usage) [4].


Reply all
Reply to author
Forward
0 new messages