Home > OS >  Exact calculation of google app engine for instances with timeout
Exact calculation of google app engine for instances with timeout

Time:10-09

I'm trying to understand how exactly the billing is calculated for Google App Engines. Suppose I have an app.yaml like the following:

runtime: python39
app_engine_apis: true

instance_class: B1
basic_scaling:
  max_instances: 1
  idle_timeout: 1m

with a pricing of 0.06$/hour.

Could you verify these statements for me?

  1. Can there ever be more than one instance active? (e.g. on different deployed versions)
  2. If I receive a request which takes 1 second to complete, then the instance will turn on for 61 seconds (1 second request 60 seconds idle).
  3. Continuing from 2., is the billing computed by the second or minute? i.e. will I pay for 61 seconds, or 2 minutes? (or something else)

CodePudding user response:

  1. Can there ever be more than one instance active? (e.g. on different deployed versions)

For this Statement, As per YAML given in question the max instance is only 1 so there is no more chance of instance active. But as per official docs , basic scaling of instance classes B1 and higher, can contain the following elements: Max_instances: Required. The maximum number of instances for App Engine to create for this service version. This is useful to limit the costs of a service. Idle_timeout : Optional. The instance will be shut down this amount of time after receiving its last request. The default is 5 minutes (5m).

Example :

basic_scaling:
max_instances: 11
idle_timeout: 10m

So, Here if one shutdown another will be active if the max instance is more than one.

2.If I receive a request which takes 1 second to complete, then the instance will turn on for 61 seconds (1 second request 60 seconds idle).

Accrual of instance hours begins when an instance starts and ends as described below, depending on the type of scaling you specify for the instance:

Basic or automatic scaling: accrual ends fifteen minutes after an instance finishes processing its last request.

Manual scaling: accrual ends fifteen minutes after an instance shuts down. If the number of idle instances created by App Engine exceeds the maximum you specify in the Performance Settings tab of the Google Cloud console, the excess instances do not accrue instance hours.

3.Continuing from 2., is the billing computed by the second or minute? i.e. will I pay for 61 seconds, or 2 minutes? (or something else)

Billing is computed by Hours basis and as explained in point 2.

Refer to these docs for scaling elements , App engine pricing , Google Pricing Calculator .

  • Related