什么会导致App Engine请求中未被更改的时间变化很大? [英] What can cause high variability of Untraced Time in App Engine requests?

查看:104
本文介绍了什么会导致App Engine请求中未被更改的时间变化很大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚对我的应用程序进行了负载测试。我注意到两个相同请求的延迟有非常大的变化:3秒和30秒。当我挖掘到痕迹时,发现以下内容:

  | |追踪(ms)|非法(ms)| 
| ---------------------- + ------------- + -------- ------- |
|高延迟请求| 193 | 29948 |
|低延迟请求| 305 | 2934 |

以下是这些痕迹的屏幕截图:

<低整体延迟





高整体延迟



我无法理解运行时性能与10比1的差异。



我只能看到负载下的这些高延迟请求。在我的代码中有什么东西可以说明这种变化(假设这两个请求都遵循相同的代码路径)?

我的经验,那些非常高的延迟是由一个新的实例启动引起的。 AppEngine Google小组讨论了类似的问题: https: //groups.google.com/d/msg/google-appengine/MBveo1KSTyY/mkYdyCmfAgAJ



您可以做两件事:


  1. 通过减少应用程序的整体大小(代码,库,资产)和大量使用延迟初始化来减少实例开始所需的时间。使用更高级的实例类可能也有帮助(更强大的实例启动速度更快)
  2. 调整缩放选项:始终有一个(或两个)空闲实例挂起,因此无需等待在流量高峰期启动的实例

希望有所帮助。就我而言,使用更高级的实例类已经帮助了很多!


I just ran a load test against my app. I noticed some very large variability in latency for two identical requests: 3 s vs. 30 s. When I dug into the traces I found the following:

|                      | Traced (ms) | Untraced (ms) |
|----------------------+-------------+---------------|
| High-latency Request |         193 |         29948 |
| Low-latency Request  |         305 |          2934 |

Here are screen shots for the traces:

Low overall latency

High overall latency

I cannot make sense of a 10-to-1 difference in runtime performance.

I only see these high-latency requests under load. Could something in my code account for this variability (assuming the same path through the code was followed for both requests)?

解决方案

In my experience, those extraordinarily high latencies are caused by a fresh instance starting up. There was a discussion in the AppEngine Google Group which is about similar issues: https://groups.google.com/d/msg/google-appengine/MBveo1KSTyY/mkYdyCmfAgAJ

Two things you can do:

  1. reduce time it takes an instance to start by reducing overall size of your application (code, libraries, assets) and heavy use of lazy initialization. Using a higher instance class might help too (stronger instances boot up faster)
  2. tweak your scaling options: always have one (or two) idle instances hanging around so there is no need to wait for an instance to boot during traffic peaks

Hope that helps. In my case, using a higher instance class helped a lot already!

这篇关于什么会导致App Engine请求中未被更改的时间变化很大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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