원격 API에서 데이터 검색의 병렬 처리를 시도하고 있습니다. 원격 API에는 대용량 기능이 없으므로 필요한 각각의 객체에 대해 별도의 GET 요청을 만들어야합니다.요청으로 gevent/greenlets를 사용할 때 ServerNotFoundError 받기
나는 gevent를 믹스에 추가했습니다. 때로는 잘 작동하지만 다시 동일한 요청을 시도하면 100 개 중 50 개가 다음과 같이 실패합니다.
Traceback (most recent call last):
...
File "/Users/---/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1570, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/Users/---/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1317, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/Users/---/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1258, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
ServerNotFoundError: Unable to find the server at my.remote.host
<Greenlet at 0x10c6eacd0: function_name(<Object1>, <Object2>, u'zebra', True)> failed with ServerNotFoundError
해결 방법에 대한 의견이 있으십니까? 너무 많은 요청이 너무 빨리 발생 했습니까? 그렇다면, 그린렛의 수를 줄이는 쉬운 방법이 있습니까?