[英]Appengine performance problem. Same site 10x faster accessing from appspot than from my domain
This is really strange to me and it's becoming into a real problem. 这对我来说真的很奇怪,它正在成为一个真正的问题。
I'm building a site in appengine (java) using scala and It's working really slow when accessed from my domain: 我正在使用scala在appengine(java)中构建一个站点,当从我的域访问时它工作得非常慢:
/latest 200 1505ms 2325cpu_ms 1586api_cpu_ms 4kb
But when accessed from appspot it works much faster: 但是当从appspot访问它时,它的工作速度要快得多:
/latest 200 180ms 269cpu_ms 221api_cpu_ms 4kb
I've buyed the domain through google apps so it's automatically configured. 我通过谷歌应用程序购买了域名,因此它会自动配置。 I can't figure out how can this be happening... Can it be something in my code?
我无法弄清楚这是怎么发生的......它可以在我的代码中出现吗? Or is it something about configuration?
或者它是配置的东西?
The problem is perfectly reproducible, and if you need to see the speed difference it's noticeable by simply accessing the site. 这个问题是完全可重复的,如果你需要看到速度差异,只需访问该网站即可。 these are the links:
这些是链接:
http://secretsapp.appspot.com/latest http://secretsapp.appspot.com/latest
http://www.whatasecret.com/latest http://www.whatasecret.com/latest
Thanks a lot. 非常感谢。
The most likely explanation for this is that you sent your first request to a fresh runtime, which took some time to start up, while the request to the appspot domain was served by an already warmed-up runtime (probably the same one). 最可能的解释是,您将第一个请求发送到新的运行时,这需要一些时间来启动,而对appspot域的请求则由已经预热的运行时(可能是相同的)运行。 Try sending several requests to each domain and taking the minimum - there shouldn't be a statistically significant difference.
尝试向每个域发送多个请求并采取最小值 - 不应存在统计上显着的差异。
Just accessed both links and they seem to take approx the same time, though it took a long time to start loading. 只是访问了两个链接,它们似乎需要大约相同的时间,虽然它需要很长时间才能开始加载。 I guess since these are newly registered domains, they were not yet cached by your ISPs DNS server, so the latest domain is taking a while longer to resolve.
我想因为这些是新注册的域名,所以它们尚未被您的ISP DNS服务器缓存,因此最新域名需要更长时间才能解决。 hopefully the problem should disappear in a short time.
希望这个问题能在短时间内消失。
I found out the reason.... It was a cookie related problem that was in my code. 我发现了原因....这是我的代码中的cookie相关问题。
It was retrieving a lot of entities from the db when the user had voted some posts (wich is stored in a cookie). 当用户投票一些帖子(存储在cookie中)时,它正在从数据库中检索大量实体。 So I had voted in one domain and not the other.
所以我投票在一个域而不是另一个域。 It's now fixed.
它现在已修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.