-
Notifications
You must be signed in to change notification settings - Fork 4k
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:
grpc-java/core/src/main/java/io/grpc/internal/AbstractStream.java
Lines 108 to 109 in 81da3eb
| @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?