Google App Engine 中的实例延迟
我正在运行一个免费应用程序,并使用 GAE 的 Python 运行时使用 1 个最大空闲实例。
根据 http://code.google.com/appengine/docs/adminconsole/instances .html,
应用程序的延迟对数量的影响最大 为您的流量提供服务所需的实例。如果您提出服务请求 很快,单个实例可以处理大量请求。
这似乎表明最好将“应用程序设置”中的滑块调整为最小延迟。
似乎高延迟有利于防止负载峰值启动新实例。
那么,延迟基本上是响应请求峰值的能力(高延迟)与给定时间段内处理的请求数量(低延迟)之间的权衡吗?
I am running a free application and using 1 max idle instance using GAE's Python runtime.
According to http://code.google.com/appengine/docs/adminconsole/instances.html,
Your application's latency has the biggest impact on the number of
instances needed to serve your traffic. If you service requests
quickly, a single instance can handle a lot of requests.
This seems to suggest that adjusting the slider in 'Application Settings' to minimum latency would be best.
However, according to http://code.google.com/appengine/docs/adminconsole/performancesettings.html#Setting_the_Minimum_Pending_Latency,
it seems like having a high latency is good for preventing load spikes from spinning up new instances.
So is latency basically a tradeoff between ability to respond to request spikes (high latency) vs. number of requests handled over a given time period (low latency)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“待处理延迟”是指在 App Engine 决定启动另一个实例之前请求可以在队列中停留的时间。如果请求到达时所有应用程序实例都繁忙,则该请求将在队列中等待下一个可用实例处理。如果超出最小值,App Engine 可能会决定启动一个新实例来处理该请求。 (您还可以调整最大挂起延迟设置。)
最小挂起延迟是可配置的,因为启动新实例需要时间和金钱。较大的最小挂起延迟意味着 App Engine 在启动新实例之前会更长时间地保留挂起请求(并使它们等待),从而有利于处理更多流量的能力的实例成本。较小的最小挂起延迟意味着随着流量的增加,App Engine 将更频繁地启动新实例。
术语“延迟”仅指您的应用程序响应请求所需的时间。您的应用程序响应请求的速度越快,单个实例可以处理的请求就越多,并且请求队列通常越短。较低的延迟总是好的,但这取决于应用程序是否能够快速完成需要执行的操作。
"Pending latency" refers to how long a request can be sitting in the queue before App Engine decides to spin up another instance. If all of your app instances are busy when a request arrives, the request will wait in a queue to be handled by the next available instance. If it's there beyond the minimum, App Engine may decide to start up a new instance to handle the request. (There's also a maximum pending latency setting you can adjust.)
The minimum pending latency is configurable because starting up a new instance takes time and costs money. A larger minimum pending latency means App Engine will hold onto pending requests longer (and make them wait) before starting new instances, favoring instance cost to the ability to handle more traffic. A smaller minimum pending latency means App Engine will start new instances more often, as traffic picks up.
The term "latency" simply refers to how long it takes for your app to respond to a request. The faster your app can respond to requests, the more requests a single instance can handle, and the shorter the request queue will typically be. Lower latency is always good, but it's up to the app to do what it needs to do quickly.