drive: increase default chunk size to 8 MB and document - fixes #397

This commit is contained in:
Nick Craig-Wood 2016-04-12 21:33:55 +01:00
parent 9539bbf78a
commit ddb47758f3
2 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
--- ---
title: "Google drive" title: "Google drive"
description: "Rclone docs for Google drive" description: "Rclone docs for Google drive"
date: "2015-09-12" date: "2016-04-12"
--- ---
<i class="fa fa-google"></i> Google Drive <i class="fa fa-google"></i> Google Drive
@ -129,16 +129,20 @@ system.
#### --drive-chunk-size=SIZE #### #### --drive-chunk-size=SIZE ####
Upload chunk size. Must a power of 2 >= 256k. Default value is 256kB. Upload chunk size. Must a power of 2 >= 256k. Default value is 8 MB.
Making this larger will improve performance, but note that each chunk
is buffered in memory one per transfer.
Reducing this will reduce memory usage but decrease performance.
#### --drive-full-list #### #### --drive-full-list ####
Use a full listing for directory list. More data but usually No longer does anything - kept for backwards compatibility.
quicker. On by default, disable with `--full-drive-list=false`.
#### --drive-upload-cutoff=SIZE #### #### --drive-upload-cutoff=SIZE ####
File size cutoff for switching to chunked upload. Default is 256kB. File size cutoff for switching to chunked upload. Default is 8 MB.
#### --drive-use-trash #### #### --drive-use-trash ####

View File

@ -51,7 +51,7 @@ var (
driveExtensions = pflag.StringP("drive-formats", "", defaultExtensions, "Comma separated list of preferred formats for downloading Google docs.") driveExtensions = pflag.StringP("drive-formats", "", defaultExtensions, "Comma separated list of preferred formats for downloading Google docs.")
// chunkSize is the size of the chunks created during a resumable upload and should be a power of two. // chunkSize is the size of the chunks created during a resumable upload and should be a power of two.
// 1<<18 is the minimum size supported by the Google uploader, and there is no maximum. // 1<<18 is the minimum size supported by the Google uploader, and there is no maximum.
chunkSize = fs.SizeSuffix(256 * 1024) chunkSize = fs.SizeSuffix(8 * 1024 * 1024)
driveUploadCutoff = chunkSize driveUploadCutoff = chunkSize
// Description of how to auth for this app // Description of how to auth for this app
driveConfig = &oauth2.Config{ driveConfig = &oauth2.Config{