简体   繁体   中英

Google App Engine: CRUDing Instances

I've read the Instances Overview for GAE and it is very informative, however when it comes to actually CRUDing Instances I'm just not seeing the "forest through the trees."

In some literature, it sounds like GAE "auto-scales" your app and dynamically calculates the number of Instances you need in order to handle the current server load. However the article above concerns itself primarily with creating and managing Instances manually via the Admin Console.

How are these two concepts related/different?

I ask because I've read the same consistent advice over and over again: try to keep the number of Instances you have running at all times as low as possible (since less Instances results with being billed less). But I'm not sure if this is a manual "pruning" job that requires me to be logging into my Admin Console every 10 minutes to see if new Instances need to be created or existing ones destroyed/shutdown; or if this is something that is auto-calculated.

If it is auto-calculated, then what is the point of CRUDing Instances manually via the Admin Console? Thanks in advance!

AppEngine definitelly autoscales.

However, it gives you ability to tweak the auto-scale mechanism to either go for cost or performance.

Some rules:

  1. Every instance costs (however you get 28 instance hours free every day).
  2. When instance stops executing requests you stop being charged for it after 15 min of inactivity (thoughh it may stay up idle and visible in your instance list, if google has no better work for it).
  3. Every request goes in a into a Pending Queue and waits there until instance becomes available to execute it.
  4. If it waits too long a new instance will be started (= autoscaling). How long it must wait before new instance is stared is controlled by Pending Latency .
  5. If you don't want requests to wait you can have a "reserved" instance by setting Idle Instances. In this case GAE will always try to have an Idle Instance available, meaning if Idle Instance gets work to do GAE will create a new one. So your number of instances = instances doing work (processing requests) + number of Idle Instances. Basically Idle Instances are just a reserve, not doing real work, except when working instances can't cope with the load, then Idle Instance jumps in, becoming a working instance, while a new Idle Instance is being spun up. Note: Idle Instences are in admin console marked as "Resident" (why Google do you do this, why?).

Btw, where do the docs say you can manually start an instance?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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