Skip to content

Allow configuring onReady threshold #5433

@ghost

Description

Please answer these questions before submitting your issue.

What version of gRPC are you using?

v1.17.1, though this hasn't changed in later versions

What did you expect to see?

Right now isReady applies backpressure once 32 KiB of data is buffered:

@VisibleForTesting
public static final int DEFAULT_ONREADY_THRESHOLD = 32 * 1024;

However, our use cases involve larger payloads (1-2 MiB/message), which means that sending any message immediately applies backpressure. We'd like to maximize throughput, so we're OK with more memory usage (to a point). We've also found in our own benchmarks that sending a couple messages beyond when isReady changes to false increases throughput reasonably (about ~50%).

While this is an okay workaround, it'd be more convenient to be able to set the threshold manually; also, then we can manage how much data is actually enqueued, instead of selectively ignoring the backpressure signal.

Would it be acceptable to make this setting not static final (or at least not final)? Or is there another way to adjust the backpressure threshold?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions