| 51 | |
| 52 | |
| 53 | class TransferConfig: |
| 54 | def __init__( |
| 55 | self, |
| 56 | multipart_threshold=8 * MB, |
| 57 | multipart_chunksize=8 * MB, |
| 58 | max_request_concurrency=10, |
| 59 | max_submission_concurrency=5, |
| 60 | max_request_queue_size=1000, |
| 61 | max_submission_queue_size=1000, |
| 62 | max_io_queue_size=1000, |
| 63 | io_chunksize=256 * KB, |
| 64 | num_download_attempts=5, |
| 65 | max_in_memory_upload_chunks=10, |
| 66 | max_in_memory_download_chunks=10, |
| 67 | max_bandwidth=None, |
| 68 | ): |
| 69 | """Configurations for the transfer manager |
| 70 | |
| 71 | :param multipart_threshold: The threshold for which multipart |
| 72 | transfers occur. |
| 73 | |
| 74 | :param max_request_concurrency: The maximum number of S3 API |
| 75 | transfer-related requests that can happen at a time. |
| 76 | |
| 77 | :param max_submission_concurrency: The maximum number of threads |
| 78 | processing a call to a TransferManager method. Processing a |
| 79 | call usually entails determining which S3 API requests that need |
| 80 | to be enqueued, but does **not** entail making any of the |
| 81 | S3 API data transferring requests needed to perform the transfer. |
| 82 | The threads controlled by ``max_request_concurrency`` is |
| 83 | responsible for that. |
| 84 | |
| 85 | :param multipart_chunksize: The size of each transfer if a request |
| 86 | becomes a multipart transfer. |
| 87 | |
| 88 | :param max_request_queue_size: The maximum amount of S3 API requests |
| 89 | that can be queued at a time. |
| 90 | |
| 91 | :param max_submission_queue_size: The maximum amount of |
| 92 | TransferManager method calls that can be queued at a time. |
| 93 | |
| 94 | :param max_io_queue_size: The maximum amount of read parts that |
| 95 | can be queued to be written to disk per download. The default |
| 96 | size for each elementin this queue is 8 KB. |
| 97 | |
| 98 | :param io_chunksize: The max size of each chunk in the io queue. |
| 99 | Currently, this is size used when reading from the downloaded |
| 100 | stream as well. |
| 101 | |
| 102 | :param num_download_attempts: The number of download attempts that |
| 103 | will be tried upon errors with downloading an object in S3. Note |
| 104 | that these retries account for errors that occur when streaming |
| 105 | down the data from s3 (i.e. socket errors and read timeouts that |
| 106 | occur after receiving an OK response from s3). |
| 107 | Other retryable exceptions such as throttling errors and 5xx errors |
| 108 | are already retried by botocore (this default is 5). The |
| 109 | ``num_download_attempts`` does not take into account the |
| 110 | number of exceptions retried by botocore. |
no outgoing calls