gpt4 book ai didi

google-app-engine - GAE : What's the difference between and ?

转载 作者:太空宇宙 更新时间:2023-11-03 15:22:17 30 4
gpt4 key购买 nike

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

<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/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com