0

I am currently living in VN & I built my website on Google cloud. Here is the website (http://1-dot-speaklikewater.appspot.com/) (it has not finished yet).

I bought a Godaddy domain (speaklikewater.com) in replacing for (http://1-dot-speaklikewater.appspot.com/).

I setup these 8 following parameters on my Godaddy Domains:

Type    Host    Data
A   @   216.239.32.21
A   @   216.239.34.21
A   @   216.239.36.21
A   @   216.239.38.21
AAAA    @   2001:4860:4802:32::15
AAAA    @   2001:4860:4802:34::15
AAAA    @   2001:4860:4802:36::15
AAAA    @   2001:4860:4802:38::15

Now, if I open (http://1-dot-speaklikewater.appspot.com/) on any browser and at any time, then it's gonna take like 1 or 2 secs to load the page.

Now, if I open (speaklikewater.com) for first time at a certain browser, then it's gonna take like 15 to 20 secs to load. If I open it the second time in the same browser then it 's gonna take 2-3 secs to load.

This is incredibly long.

I'm living in VN right now.

Do you have the same issue? or have I done anything wrong?

Tom
  • 825
  • 1
  • 8
  • 28
  • works for me, maybe something with your browser – Igor Artamonov Apr 16 '16 at 17:29
  • @IgorArtamonov, where are you living? – Tom Apr 16 '16 at 17:29
  • I tried to remove all javascript code on the homepage but no help – Tom Apr 16 '16 at 17:42
  • Did you map `speaklikewater.com` to your app as well (*in addition* to `www.speaklikewater.com`)? – Dan Cornilescu Apr 28 '16 at 12:17
  • @DanCornilescu, I did it yesterday, set up "CNAME" ghs.googlehosted.com (www) without using naked domain. and my naked domain using Godaddy server but point to "www.speaklikewater.com". Now it runs incredibly fast. It's clear now, since I am living in VN &if I use Google Server which located in US & it could take a lot of time to access Google server. But using "ghs.googlehosted.com" is like magic. It's incredibly fast. – Tom Apr 29 '16 at 12:27
  • So what you missed was sub-step #3 (create a CNAME resource) in the step #2 (Add a custom domain) in the custom domain mapping procedure https://cloud.google.com/appengine/docs/python/console/using-custom-domains-and-ssl?hl=en#adding_a_custom_domain_for_your_application for the `www.speaklikewater.com` domain. Which was causing an additional DNS lookup (cached or not) every time you wanted to access the page. You should write an answer to your own question. – Dan Cornilescu Apr 29 '16 at 12:59
  • In other words you need to map **both** the naked domain *and* the `www` subdomain to your app - similar to this answer (only the naked domain mapping was missing in that case): http://stackoverflow.com/a/34830367/4495081 – Dan Cornilescu Apr 29 '16 at 13:10
  • @DanCornilescu, I did try mapping both naked domain and the www subdomain, but it didn't work. It will be very very slow whenever I map naked domain. So, I tried mapping www only & redirect my naked domain to www.mydomain.com And Now it runs very fast. – Tom Apr 30 '16 at 00:44

3 Answers3

2

I found the answer.

In fact, when I set up "CNAME" ghs.googlehosted.com (www), my site is extremely fast when enter "www.mydomain.com"; but it is extrememly slow when enter "mydomain.com".

So, if I map my naked domain "mydomain.com" to Google Server then it will be extrememly slow & I couldn't even access mydomain.com on mobile device. That is due to my PC in VN have to look up the Google server located in US & somehow this looking-up process is so long & caused the problem.

So, here is my answer, in app engine, I set up "CNAME" ghs.googlehosted.com (www) without using naked domain.

In Godaddy, I map my naked domain to Godaddy server & point it to "www.mydomain.com". Now it runs incredibly fast.

Using "ghs.googlehosted.com" is like magic. It's incredibly fast.

Tom
  • 825
  • 1
  • 8
  • 28
0

At least in my case I also noticed one similar rather long access time the very first time I tried to use my custom domain. It could putentially be explained by some stuff being part of the (one-time/initial) setup in the GAE infra for the custom domain. I think there might have even been a note in one of the setup screen at the time (this was about 1 year ago, with custom domain setup through Google Apps). It didn't happen since.

The very first opening of any new domain URL (not only your custom one or even appspot.com) will most likely include a (full) DNS lookup which occasionally can take a long time, depending on your internet and DNS provider(s). Subsequent requests for the same domain will most likely benefit from DNS caching, which can happen at various levels: your browser application, your OS, your router, your service provider, etc. and usually take significantly less time, most often (almost) not-noticeable.

I wouldn't worry too much about these uncached DNS long times - they aren't GAE-related and will happen now and then - usually after browser app restart and/or computer/OS/network reboots, re-configurations or upgrades.

A GAE-specific kind of longer-than-usual access is the one including the time to start an instance of your app - clearly marked as such in the GAE logs.

And we're down to the regular requests - the vast majority. There should be no noticeable difference between using the custom domain URL or the appspot.com one, regardless of your location or your internet connection (as long as it works).

You can actually measure the response times in at least some browsers (here are examples for chrome and firefox) and you can confirm that. You may need to take several measurements and compare the averages across them if your internet connection is particularly unstable.

I compared (firefox) measurements for both your URLs, I don't see anything suspect in terms of response times, I think you're OK.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • you somehow explained 30% of the problem. In fact, when I set up "CNAME" ghs.googlehosted.com (www), my site is extremely fast when enter "www.mydomain.com"; but it is extrememly slow when enter "mydomain.com". So, it's so clear now. If we use naked domain then my pc in VN have to look up the Google server which could be located in US. That could take a pretty long time. I can't even access "mydomain.com" in my smartphone. If I use "www.mydomain.com" then somehow it can access the Google server so quickly. I think I should point "mydomain.com" to "www.mydomain.com" – Tom Apr 28 '16 at 03:31
0

Using custom domains in the following regions might add noticeable latency to responses:

  • us-west2
  • us-east4
  • northamerica-northeast1
  • southamerica-east1
  • europe-west2
  • europe-west3
  • asia-south1
  • asia-northeast1
  • australia-southeast1

Source: https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains?hl=en

Érick Luís
  • 111
  • 2
  • 5