Allow tweaking the max parallel http requests via env var, fixes #9671
parent
a6d92e1eee
commit
40095b20dc
|
@ -1014,6 +1014,13 @@ similar use case), and need to support proxies, please provide the `CGI_HTTP_PRO
|
||||||
environment variable instead. See [httpoxy.org](https://httpoxy.org/) for further
|
environment variable instead. See [httpoxy.org](https://httpoxy.org/) for further
|
||||||
details.
|
details.
|
||||||
|
|
||||||
|
### COMPOSER_MAX_PARALLEL_HTTP
|
||||||
|
|
||||||
|
Set to an integer to configure how many files can be downloaded in parallel. This
|
||||||
|
defaults to 12 and must be between 1 and 50. If your proxy has issues with
|
||||||
|
concurrency maybe you want to lower this. Increasing it should generally not result
|
||||||
|
in performance gains.
|
||||||
|
|
||||||
### HTTP_PROXY_REQUEST_FULLURI
|
### HTTP_PROXY_REQUEST_FULLURI
|
||||||
|
|
||||||
If you use a proxy, but it does not support the request_fulluri flag, then you
|
If you use a proxy, but it does not support the request_fulluri flag, then you
|
||||||
|
|
|
@ -37,7 +37,7 @@ class HttpDownloader
|
||||||
private $jobs = array();
|
private $jobs = array();
|
||||||
private $options = array();
|
private $options = array();
|
||||||
private $runningJobs = 0;
|
private $runningJobs = 0;
|
||||||
private $maxJobs = 10;
|
private $maxJobs = 12;
|
||||||
private $curl;
|
private $curl;
|
||||||
private $rfs;
|
private $rfs;
|
||||||
private $idGen = 0;
|
private $idGen = 0;
|
||||||
|
@ -71,6 +71,10 @@ class HttpDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rfs = new RemoteFilesystem($io, $config, $options, $disableTls);
|
$this->rfs = new RemoteFilesystem($io, $config, $options, $disableTls);
|
||||||
|
|
||||||
|
if (is_numeric($maxJobs = getenv('COMPOSER_MAX_PARALLEL_HTTP'))) {
|
||||||
|
$this->maxJobs = max(1, min(50, (int) $maxJobs));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue