Create an API to set Cronet read buffer size
- Lingua principale
- Java
- Stelle
- 12.1k
- Fork
- 4k
- Merge medio
- 2g 17h
- PR unite (30g)
- 37
Descrizione
### Is your feature request related to a problem?
When Cronet is used as the underlying transport engine for GRPC. The default read buffer size created is quite small (4KB). This small buffer can lead to overhead especially when reading a significant amount of data (~10s MB) as each read call will incur JNI calls to fetch data from Cronet's networking thread. I believe that the default should be bumped up to 64KB. However, it'd be nice to start with adding an API that allows user to set their own read buffer size per Channel.
### Describe the solution you'd like
Add a new API `CronetChannelBuilder.setReadBufferSize(...)` to allow changing the default buffer size for read operations.
### Describe alternatives you've considered
Bump the default to a higher number (64KB)
### Additional context
We're doing some experiments regarding moving folks from Cronet to HttpEngine (Cronet in the platform). And we've noticed some latency regressions only on long-running requests which led to this investigation that GRPC-Cronet is using excessively small buffers.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal punto di ingresso CronetChannelBuilder e traccia come viene selezionato e utilizzato l’attuale buffer di lettura da 4KB per le letture JNI. Il lavoro è completato quando un’API setReadBufferSize per canale controlla quel valore e il comportamento rilevante del canale Cronet è coperto da test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- api, backend-api-design, networking
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100