Skip to content

NIO: Using custom options reduces cross-bucket performance #1343

@jean-philippe-martin

Description

@jean-philippe-martin

google-cloud-nio normally uses the default credentials, but there's an "escape hatch" to provide your own:

CloudStorageFileSystem.forBucket(String bucket, CloudStorageConfiguration config).

An unexpected side effect of the way the code is written is that when using custom credentials, bucket-to-bucket copies are slower.

The reason is that this creates a new CloudStorageFileSystemProvider. When asking for a copy across providers, NIO will read from one and write to the other (thus routing all the data via the client's computer). Instead, when it's the same provider, NIO can use the far more efficient copy method (data then don't have to leave the datacenter).

A natural fix would be for our code to check whether the passed config was seen before and, if so, reuse the same CloudStorageFileSystemProvider. This could be done directly by our users as a workaround, but it makes sense for us to do it transparently.

cc:@mziccard, @jart

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.performancepriority: p2Moderately-important priority. Fix may not be included in next release.triaged for GAtype: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions