Hi Jeff.
Thanks for your reply. I did some measurements.
First is a request made to a different remote host:
LTA Fetch on App Engine
===================
#
04-06 04:35PM 03.011 /api/v1/16061/30/ 200 768ms 168ms-cpu 0kb Mozilla/
5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/
3.1b3,gzip(gfe)
See details 218.186.10.253 - - [06/Apr/2009:16:35:03 -0700] "GET /api/
v1/16061/30/ HTTP/1.1" 200 275 - "Mozilla/5.0 (X11; U; Linux i686; en-
US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3,gzip(gfe)"
#
I 04-06 04:35PM 03.027
Method get called for APIEndPoint
#
D 04-06 04:35PM 03.036
Cache hit for stop 16061
#
I 04-06 04:35PM 03.043
Fetching URL:
http://www.publictransport.sg/public/ptp/en/Getting-Around/ArrivaltimeResults.html?hidServiceNoValue=&hidBusStopValue=16061
#
I 04-06 04:35PM 03.626
Fetched URL:
http://www.publictransport.sg/public/ptp/en/Getting-Around/ArrivaltimeResults.html?hidServiceNoValue=&hidBusStopValue=16061
=========
As you can see, this urlfetch took just over half a second to
complete.
Now a request that caused a fetch from
sbstransit.com.sg
NextBus fetch on App Engine
======================
#
04-06 04:34PM 11.864 /api/v1/17069/030/ 200 3276ms 279ms-cpu 0kb
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3) Gecko/20090305
Firefox/3.1b3,gzip(gfe)
See details 218.186.10.253 - - [06/Apr/2009:16:34:15 -0700] "GET /api/
v1/17069/030/ HTTP/1.1" 200 173 - "Mozilla/5.0 (X11; U; Linux i686; en-
US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3,gzip(gfe)"
#
I 04-06 04:34PM 12.073
Method get called for APIEndPoint
#
I 04-06 04:34PM 12.107
Fetching URL:
http://www.sbstransit.com.sg/mobileiris/index_svclist.aspx?stopcode=17069
#
W 04-06 04:34PM 15.120
Traceback (most recent call last):
File "/base/data/home/apps/sbsnextbus/6.332607848382532409/
utils.py", line 72, in get_url
result = urlfetch.fetch(url)
File "/base/python_lib/versions/1/google/appengine/api/
urlfetch.py", line 273, in fetch
raise DownloadError(str(e))
DownloadError: ApplicationError: 5
=======================
Now, the urlfetch got cut-off in 3 seconds. This is longer than usual
but still under the 5 second limit. Now for comparison, here is a log
of the same request executed on my localhost in the development
server.
On localhost
==========
INFO 2009-04-06 23:50:15,961 main.py] Method get called for
APIEndPoint
DEBUG 2009-04-06 23:50:15,962 nextbus.py] Cache hit for stop 17069
INFO 2009-04-06 23:50:15,962 utils.py] Fetching URL:
http://www.sbstransit.com.sg/mobileiris/index_mobresult.aspx?stop=17069&svc=051
DEBUG 2009-04-06 23:50:15,964 urlfetch_stub.py] Making HTTP
request: host =
www.sbstransit.com.sg, url =
http://www.sbstransit.com.sg/mobileiris/index_mobresult.aspx?stop=17069&svc=051,
payload = None, headers = {'Host': '
www.sbstransit.com.sg', 'Accept':
'*/*'}
DEBUG 2009-04-06 23:50:16,077 urlfetch_stub.py] Making HTTP
request: host =
www.sbstransit.com.sg, url =
http://www.sbstransit.com.sg/mobileiris/(yvyrjnatocvc0y55rjqlocu3)/index_mobresult.aspx?stop=17069&svc=051,
payload = None, headers = {'Host': '
www.sbstransit.com.sg', 'Accept':
'*/*'}
INFO 2009-04-06 23:50:17,259 utils.py] Fetched URL:
http://www.sbstransit.com.sg/mobileiris/index_mobresult.aspx?stop=17069&svc=051
DEBUG 2009-04-06 23:50:17,260 nextbus.py] Saved cache for stop, svc
17069, 051
INFO 2009-04-06 23:50:17,274 dev_appserver.py] "GET /api/
v1/17069/051/ HTTP/1.1" 200 -
=============
On localhost, the urlfetch completed in just under 1.5 seconds.
Doesn't this indicate that (a) this could be a latency issue between
Google's servers & SBS Transit's servers? and (b) request should still
not be cut-off since it is well under the ~5 seconds limit.
I know the 5 seconds limit is not documented (at least I can't find
it) but it is an issue if it keeps changing all the time.
Any thoughts?
Cheers,
Deepak