Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Command line flag to disable HTTP compression. #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ipopov
Copy link

@ipopov ipopov commented Feb 25, 2018

When you're on a machine with extremely high bandwidth to Google, and limited CPU, disabling gzip-compression can improve throughput by 10x. Specifically, this makes gdrive run much much faster on Google Compute Engine virtual machines.

The effect of this change is that the --disable-compression flag unsets the "Accept-Encoding: gzip" header in HTTP requests.

In my tests, gzip compression limits throughput to 20-30MB/s, whereas uncompressed transfers can reach 300MB/s.

Note that, if you want to reproduce this experiment, you should do so with a large file: in my experience, Drive never gzip-compresses downloads in the tens of GBs, but does gzip-compress a 200GB file.

msfjarvis added a commit to msfjarvis/gdrive that referenced this pull request Nov 11, 2018
Command line flag to disable HTTP compression.

* git://github.com/prasmussen/gdrive:
  Command line flag to disable HTTP compression.
@picaro8
Copy link

picaro8 commented Dec 10, 2019

For some unknown go reason I can't build your branch, or when applied to master, as go doesn't pick up that the function prototypes in 'auth/oauth.go' have changed, and keeps wanting the old ones. Any tricks to make it build?

@ipopov
Copy link
Author

ipopov commented Dec 10, 2019

Hi, picaro8,

Yes, I see what you're talking about. I believe the problem is with the "vendoring" approach that the gdrive project has taken- namely, that many of the imports are not relative, but absolute imports. (e.g. "github.com/prasmussen/gdrive/auth" instead of "./auth".

Thus, the patch only works when applied to prasmussen's master.

You can apply it as follows:

go get github.com/prasmussen/gdrive
cd ~/go/src/github.com/prasmussen/gdrive
curl -sL https://patch-diff.githubusercontent.com/raw/gdrive-org/gdrive/pull/374.patch | git am
go build

Please let me know if that worked!

I'm not a big enough Golang expert to fix this more elegantly. I hope that the request can just get merged in, and we won't have this problem anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants