为什么API调用需要80毫秒的延迟才能到达控制器(在Google App Engine中)? [英] Why API call take 80 ms latency to reach controller (in Google App Engine)?

查看:218
本文介绍了为什么API调用需要80毫秒的延迟才能到达控制器(在Google App Engine中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


对于每个调用到达控制器的Api,它需要80毫秒的延迟,我试过所有的实例类,结果是一样的,我还没有找到任何解决方案。如图所示,RPC调用从第80个毫秒开始,剩下的时间用在我的代码的外面。

可能 GAE基础代码在您的应用程序代码被调用之前针对每个请求执行 ,这是PaaS的本质:它为您提供了更简单的应用程序代码的便利一部分需要执行的东西,并为您执行。



同样,您将花费时间在您用于简化您的框架和库中应用代码。即使这不是字面上的代码,它仍然是您的应用程序的代码。



您可以通过检查GAE上看到的一些真实完整痕迹来获得一瞥(不一定是定量的) 。至少在我的(python)应用程序的情况下,堆栈跟踪通常比我的代码调用多出几倍于我的代码的调用。


For every Api call to reach controller, it is taking 80ms latency, i have tried all the instance classes, result is same, i have not found any solution for this. As show in the image, RPC call starts at 80th ms, remaining time spending out side of my code.

解决方案

Well, there may be a lot of GAE infra code executing for every request before your app code is invoked - it's the nature of PaaS: it gives you the convenience of simpler app code by taking a portion of the stuff that needs to be executed and performing it for you.

Similarly there will be time spent in the framework(s) and libraries you use to simplify your app code. Even if it's not literally your code it's still your app's code.

You can get a glimpse (not necessarily quantitative) of that by checking some real full strack traces seen on GAE. At least in my (python) app's case a stack trace often shows several times more calls outside my code than calls from my code.

这篇关于为什么API调用需要80毫秒的延迟才能到达控制器(在Google App Engine中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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