AsyncHTTPClient max_clients

AsyncHTTPClient max_clients

我在tornado中设置最大AsyncHTTPClients的数量如下:

AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient",max_clients=2000)

如您所见,我正在使用 curl_httpclient。假设硬件可以处理更多客户端,那么 OS(在本例中为 Linux)或 libcurl 中是否存在任何其他软件限制。例如,如果我设置 max_clients=10000 这应该开箱即用吗?

此外,如果我有多个进程 运行 龙卷风,每个进程都使用 AsyncHTTPClient,每个进程将获得 max_clients 还是 max_clients 号码在所有进程之间共享?

更新

好的,文档说明:

If additional keyword arguments are given, they will be passed to the constructor of each subclass instance created. The keyword argument max_clients determines the maximum number of simultaneous fetch() operations that can execute in parallel on each IOLoop. Additional arguments may be supported depending on the implementation class in use.

所以因为每个进程都有自己的 IOLoop 我猜这意味着每个进程最多可以使用 max_clients

您可能还需要 increase the file descriptor limit. Curl may use up to 4x (default of CURLM_MAXCONNECTS) 尽可能多的文件描述符 max_clients(除了您的进程可能需要的其他文件描述符)。

可能还有其他特定于您的环境、网络或您正在抓取的站点的限制。