google-app-engine - GAE : What's the difference between <min-pending-latency> and <max-pending-latency>?

标签 google-app-engine

据我所知,这两种设置都做同样的事情:当请求在待处理队列中花费的时间超过该设置所说的时间时,启动一个新实例。

<max-pending-latency> The maximum amount of time that App Engine should allow a request to wait in the pending queue before starting a new instance to handle it. Default: "30ms".

  • A low maximum means App Engine will start new instances sooner for pending requests, improving performance but raising running costs.
  • A high maximum means users might wait longer for their requests to be served, if there are pending requests and no idle instances to serve them, but your application will cost less to run.

<min-pending-latency> The minimum amount of time that App Engine should allow a request to wait in the pending queue before starting a new instance to handle it.

  • A low minimum means requests must spend less time in the pending queue when all existing instances are active. This improves performance but increases the cost of running your application.
  • A high minimum means requests will remain pending longer if all existing instances are active. This lowers running costs but increases the time users must wait for their requests to be served.

来源:https://cloud.google.com/appengine/docs/java/config/appref

那么min和max有什么区别呢?

最佳答案

为了理解这些设置,您可能缺少的信息是 App Engine 可以选择在 min-pending-latency 和 max-pending-latency 之间的任何时间创建实例。

这意味着在 min-pending-latency 之前永远不会创建一个实例来为挂起的请求提供服务,并且将始终在达到 max-pending-latency 后创建。

我认为最好的理解方式是查看请求进入待处理队列时的事件时间线:

  1. 请求到达应用程序但没有实例可用于为其提供服务,因此它被放置在待处理请求队列中。
  2. 直到达到 min-pending-latency:App Engine 尝试寻找一个可用的实例来满足请求并且不会创建一个新实例。如果请求低于此阈值,则表示 App Engine 缩减规模。
  3. 在达到 min-pending-latency 之后,直到达到 max-pending-latency:App Engine 尝试寻找一个可用的实例来满足请求。
  4. 达到 max-pending-latency 后:App Engine 停止搜索可用实例来满足请求并创建一个新的实例实例。

来源:app.yaml automatic_scaling element

关于google-app-engine - GAE : What's the difference between <min-pending-latency> and <max-pending-latency>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40708265/

相关文章:

android - 默认 "appengine connected Android project"500 错误

java - 无法访问管理控制面板或部署 App Engine 应用程序

python - 强制YouTube API upload_video.py身份验证在外部浏览器中打开?

java - 使用 HTTP 3XX 重定向到 Google Cloud Storage 对象?

java - 将 JDO 项目迁移到 google cloud endpoints v2,服务器返回 NoClassDefFoundError

python - 属性错误 : 'module' object has no attribute 'strptime' -- Possible Bug?

google-app-engine - 下载旧版本的 Google App Engine SDK

python - ndb 事务中访问的最大实体组数的定义?

css - 如何根据用户操作系统更改CSS

google-app-engine - 延迟的 API 调用似乎无法在正常的前端实例上运行