Whilst using App Engine Flex in the australia-southeast1 region, I’ve noticed a significant degradation in latency when I try to hit my services through configured custom domains.
For example, average latency for requests between the two might look like:
https://[MY_APP].appspot.com/[SOME_ENDPOINT] = 30ms
https://[MY_CUSTOM_DOMAIN]/[SOME_ENDPOINT] = 500ms
The later is not really an acceptable average for my users - it really impacts their user experience - so for the meantime, I’ve reverted to using the appspot domain.
I can confirm that regardless which URL I use, the server itself processes the requests in the same average time.
So I suppose my question is - Why? Why is there so much latency introduced when using custom domains?
My theory is that it has something to do with the DNS A Records that app engine requests you to use for the custom domain. When trying to ping them I get the following results:
PING 216.239.32.21 (216.239.32.21): 56 data bytes
64 bytes from 216.239.32.21: icmp_seq=0 ttl=44 time=138.100 ms
64 bytes from 216.239.32.21: icmp_seq=1 ttl=44 time=137.941 ms
64 bytes from 216.239.32.21: icmp_seq=2 ttl=44 time=138.883 ms
64 bytes from 216.239.32.21: icmp_seq=3 ttl=44 time=140.659 ms
64 bytes from 216.239.32.21: icmp_seq=4 ttl=44 time=137.879 ms
64 bytes from 216.239.32.21: icmp_seq=5 ttl=44 time=172.411 ms
64 bytes from 216.239.32.21: icmp_seq=6 ttl=44 time=167.350 ms
Hello Taylor,
Currently, custom domains have a higher latency due to architectural reasons in both australia-southeast1 and asia-northeast1 regions. However, there is already an effort underway to make it similar in terms of latency to the appspot.com. You may follow up, or comment about it at this issue tracker report. Unfortunately we cannot provide or guarantee an ETA at this moment of time.