views:

243

answers:

3

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:

/latest 200 1505ms 2325cpu_ms 1586api_cpu_ms 4kb

But when accessed from appspot it works much faster:

/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://www.whatasecret.com/latest

Thanks a lot.

+2  A: 

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). Try sending several requests to each domain and taking the minimum - there shouldn't be a statistically significant difference.

Nick Johnson
I've made a lot of request, refreshed both several times... That's why I said "The problem is perfectly reproducible". I'm sure That's not the problem.
Damian
+1 with Nick. I've just give it a try : i've called http://secretsapp.appspot.com/latest first, then http://www.whatasecret.com/latest. My first request took "ages", the second was instant :)
Olivier
+1  A: 

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. hopefully the problem should disappear in a short time.

aldrin
+1 They both took forever the first time I tried loading them (at the same time), and now they are both quick. This is a good possible explanation.
Chris
+1  A: 

I found out the reason.... It was a cookie related problem that was in my code.

It was retrieving a lot of entities from the db when the user had voted some posts (wich is stored in a cookie). So I had voted in one domain and not the other. It's now fixed.

Damian