Skip to content

Create an API to set Cronet read buffer size #12198

@aymanm-google

Description

@aymanm-google

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions