What happens if an application calls more than 10 asynchronous URL Fetch on Google App Engine?

后端 未结 4 1855
暗喜
暗喜 2021-01-02 03:00

Reading the Google App Engine documentation on asynchronous URL Fetch:

The app can have up to 10 simultaneous asynchronous URL Fetch calls

4条回答
  •  我在风中等你
    2021-01-02 03:42

    Umm, Swizzec is incorrect. Easy enough to test:

    rpc = []
    for i in range(1,20):
        rpc.append(urlfetch.createrpc())
        urlfetch.make_fetch_call(rpc[-1],"http://stackoverflow.com/questions/3639855/what-happens-if-i-call-more-than-10-asynchronous-url-fetch")
    
    for r in rpc:
        response = r.get_result().status_code
    

    This does not return any exceptions. In fact, this works just fine! Note that your results may vary for non-billable applications.

    What Swizec is reporting is a different problem, related to maximum simultaneous connections INTO your application. For billable apps there is no practical limit here btw, it just scales out (subject to the 1000ms rule).

    GAE has no way of knowing that your request handler will issue a blocking URL fetch, so the connection 500's he is seeing are not related to what his app is actually doing (that's an oversimplification btw, if your average request response time is > 1000ms your likelyhood of 500's increases).

提交回复
热议问题