googleapis / googleapis/java-storage

Feature request: expose ChannelPoolSettings on GrpcStorageOptions.Builder

Offen
#3,553 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: storage
Vorherrschende Sprache
Java
Sterne
141
Forks
93
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Is your feature request related to a problem? Please describe.

We use `StorageOptions.grpc()` with Direct Path on GKE for high-throughput writes (`WriteChannel`, resumable uploads). A single commit can trigger **hundreds of concurrent uploads** per pod.

`GrpcStorageOptions` builds `InstantiatingGrpcChannelProvider` without `setChannelPoolSettings()`, so the default is effectively **one gRPC channel**. With ~100+ concurrent RPCs, calls queue on that channel and we see high tail latency and underused bandwidth.

`ChannelPoolSettings` can be set on `StorageSettings` + `StorageClient`, but the high-level `Storage` API from `StorageOptions.grpc().build().getService()` offers no way to pass those settings.

(`google-cloud-storage` 2.34.0+, resolves to 2.55.x in our build.)

## Describe the solution you'd like

Add `setChannelPoolSettings(ChannelPoolSettings)` to `GrpcStorageOptions.Builder`, wired through to `InstantiatingGrpcChannelProvider` in `resolveSettingsAndOpts()`. Default unchanged when unset.

```java
Storage storage = StorageOptions.grpc()
.setProjectId(projectId)
.setChannelPoolSettings(ChannelPoolSettings.builder()
.setInitialChannelCount(8)
.setMaxChannelCount(16)
.setMaxRpcsPerChannel(50)
.build())
.build()
.getService();
```

## Describe alternatives you've considered

- **`StorageClient` + custom `StorageSettings`** — channel pool works, but not compatible with high-level `Storage` / `WriteChannel`.
- **Copy `resolveSettingsAndOpts()` in app code** — fragile.
- **Upload concurrency limit in app** — does not fix single-channel RPC queuing.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in GrpcStorageOptions.Builder und folge resolveSettingsAndOpts(), um zu sehen, wie InstantiatingGrpcChannelProvider konfiguriert wird. Füge die angeforderte Builder-Einstellung hinzu und überprüfe, dass StorageOptions.grpc().build().getService() sie akzeptiert, während das Verhalten unverändert bleibt, wenn die Einstellung nicht gesetzt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
grpc, java
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
76/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.