google app engine - why my app reaches GAE `Incoming Bandwidth` while it just fetches tiny content -
my app use urllib2 fetch remote http file. not fetch whole file, read 5 bytes it. purposely save quota. line 'content = remotefilefh.read(5)' below does.
def httpgetfile(self,remotefile): print 'downloading %s...'%remotefile, remotefilefh = urllib2.urlopen(remotefile) content = remotefilefh.read(5) print 'content:%s' % content remotefilefh.close() print 'done.'
but seems still consume 'incoming bandwidth' fetching whole file. why? how google host service calculate that?
the urlfetch service doesn't support fetching partial content. on app engine, urllib2
wrapper on urlfetch, whole response fetched , made available application whether read or not.
Comments
Post a Comment