Propagate upload: Change the default chunk size to 5MiB and make chunk upload parallel

The server is slow to process each chunk. As a result the time between
the chunks is not neglectible. Therefore we gain a lot of time by
uploading the chunks in parallel. So the bandwitdh is used when the
server is waiting between chunks.
This commit is contained in:
Olivier Goffart 2015-01-14 11:20:09 +01:00
parent 7f1593c5d7
commit 6a0c9fdd34

View file

@ -47,7 +47,7 @@ static qint64 chunkSize() {
if (!chunkSize) {
chunkSize = qgetenv("OWNCLOUD_CHUNK_SIZE").toUInt();
if (chunkSize == 0) {
chunkSize = 20*1024*1024; // default to 20 MiB
chunkSize = 5*1024*1024; // default to 5 MiB
}
}
return chunkSize;
@ -380,7 +380,7 @@ void PropagateUploadFileQNAM::startNextChunk()
_currentChunk++;
QByteArray env = qgetenv("OWNCLOUD_PARALLEL_CHUNK");
bool parallelChunkUpload = env=="true" || env =="1";;
bool parallelChunkUpload = env!="false" && env != "0";
if (_currentChunk + _startChunk >= _chunkCount - 1) {
// Don't do parallel upload of chunk if this might be the last chunk because the server cannot handle that
// https://github.com/owncloud/core/issues/11106