GAE:< min-pending-latency>有什么区别?和<最大等待时间>? [英] GAE: What's the difference between <min-pending-latency> and <max-pending-latency>?

查看:131
本文介绍了GAE:< min-pending-latency>有什么区别?和<最大等待时间>?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我可以读取文档,两个设置都做同样的事情:当一个请求花在待处理队列中的时间超过设置的时间时启动一个新实例。



< blockquote>

< max-pending-latency> App Engine应该允许请求在启动之前在未决队列中等待的最长时间一个新的实例来处理它。默认值:30ms。


  • 较低的最大值意味着App Engine将尽快为未决请求启动新实例,从而提高性能,但会增加运行成本。

  • 如果存在挂起的请求并且没有空闲实例来为它们提供服务,但用户可能会等待更长的时间来处理它们的请求,但是应用程序的运行成本会更低, li>


< min-pending-latency>
App Engine应该允许请求在启动一个新实例来处理它之前等待未决队列。




  • 低的最小值表示请求当所有现有实例处于活动状态时,必须在待处理队列中花费更少时间这会提高性能,但会增加运行应用程序的成本。
  • 如果所有现有实例都处于活动状态,则最小值意味着请求将保持更长时间。这降低了运行成本,但增加了用户必须等待他们的请求被送达的时间。 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. 在达到最大等待时间之后:App Engine 停止搜索提供请求的可用实例,创建新实例。


    As far as I can read the docs, both settings do the same thing: start a new instance when a request has spent in pending queue longer than that setting says.

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

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

    What's the difference between min and max then?

    解决方案

    The piece of information you might be missing to understand these settings is that App Engine can choose to create an instance at any time between min-pending-latency and max-pending-latency.

    This means an instance will never be created to serve a pending request before min-pending-latency and will always be created once max-pending-latency has been reached.

    I believe the best way to understand is to look at the the timeline of events when a request enters the pending queue:

    1. A request reaches the application but no instance are available to serve it so it is placed in the pending requests queue.
    2. Until the min-pending-latency is reached: App Engine tries to find an available instance to serve the request and will not create a new instance.
    3. After the min-pending-latency is reached and until max-pending-latency is reached: App Engine tries to find an available instance to serve the request and can choose to create a new instance.
    4. After the max-pending-latency is reached: App Engine stops searching for an available instance to serve the request and creates a new instance.

    这篇关于GAE:&lt; min-pending-latency&gt;有什么区别?和&lt;最大等待时间&gt;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆