feat(firestore): Increase HTTP/2 flow control window#10116
Conversation
…imentalGrpcFlowControlWindow setting for Node.js Allows configuring the gRPC flow control window in Node.js environments. Also sets the default flow control window size to 256KB (from the 64KB gRPC default).
🦋 Changeset detectedLatest commit: 1d4cdcf The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Code Review
This pull request increases the default HTTP/2 flow control window size from 64 KB to 256 KB for Node.js environments and introduces a new "experimentalGrpcFlowControlWindow" configuration option in "FirestoreSettings". The review feedback recommends adding an upper bound validation of 2,147,483,647 (2^31 - 1) to "experimentalGrpcFlowControlWindow" to comply with the HTTP/2 specification and prevent potential runtime connection failures, along with a corresponding unit test to verify this limit.
…lWindow Drops the 'experimental' prefix from the setting name to maintain consistency with the Android API and avoid overloading the experimental prefix (which is reserved for long-polling). Also includes validation against the HTTP/2 maximum legal limit of 2147483647.
|
|
||
| // @public | ||
| export interface Settings { | ||
| experimentalGrpcFlowControlWindow?: number; |
There was a problem hiding this comment.
I think we would remove experimental?
Allows configuring the gRPC flow control window in Node.js environments. Also sets the default flow control window size to 256KB (from the 64KB gRPC default).
grpcFlowControlWindowconfiguration option toFirestoreSettings.This change is aiming to reduce latency of large document reads in Firestore. There's a possibility that this change increases memory usage in heavy workloads which execute a large number of large document reads concurrently, which could be an issue in memory-constrained environments such as Cloud Functions with 256 MB RAM. If you believe this change introduce a regression in your app, you can revert it with the following: