Use a higher value for connecion_pool_maxsize.

Fixes #26
This commit is contained in:
Sergi Almacellas Abellana 2017-08-22 09:30:38 +02:00
parent 4127e1afa9
commit c38bc4d53a

View File

@ -20,6 +20,7 @@
from __future__ import absolute_import
import multiprocessing
import logging
import sys
@ -83,11 +84,12 @@ class ConfigurationObject(object):
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. Increasing this is useful for cases when you are
# making a lot of possibly parallel requests to the same host,
# which is often the case here.
# When set to `None`, will default to whatever urllib3 uses
self.connection_pool_maxsize = None
# per pool. urllib3 uses 1 connection as default value, but this is
# not the best value when you are making a lot of possibly parallel
# requests to the same host, which is often the case here.
# cpu_count * 5 is used as default value to increase performance
# This is used because it's the default value for ThreadPoolExecutor
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# http proxy setting
self.http_proxy_url = None