简体   繁体   English

引擎性能问题。 同一站点从appspot访问速度比从我的域访问快10倍

[英]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.

相关问题 Go 迭代器从 Bigquery 读取 100 万行比 Java 或 kotlin 慢 10 倍? - Go Iterator reading 1 million rows from Bigquery 10x slower than Java or kotlin? 我的应用下载量意外减少了10倍以上 - My app downloads decreased very unexpectedly more than 10x times Java 8 Stream Matrix Multiplication 10X比For Loop慢? - Java 8 Stream Matrix Multiplication 10X Slower Than For Loop? 将appspot域转发到我的域 - Forward appspot domain to my domain 从数据库访问数据的速度比从Arraylist访问数据的速度快 - Is accessing data from database faster than accessing from Arraylist Spring Intellij 中的启动应用程序:调试时间比运行时间长 10 倍 - Spring Boot app in Intellij: Debug takes 10x longer than Run 不使用VPN时,Powermock / Easymock测试花费的时间是原来的10倍 - Powermock/Easymock tests take 10x as long when not on VPN 直接访问对象比从文件读取快94,117倍? - Accessing Object Directly = 94,117 Times Faster than Reading from File? 使用.Net从Oracle DB读取数据比使用Java快10倍 - Reading data from Oracle DB using .Net is 10 times faster than using Java 如何从我的域中提取500多个用户对象? - How to pull more than 500 user objects from my domain?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM