Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure back-pressure in gRPC streams #211

Open
lovromazgon opened this issue Feb 11, 2022 · 1 comment
Open

Ensure back-pressure in gRPC streams #211

lovromazgon opened this issue Feb 11, 2022 · 1 comment
Labels
feature New feature or request roadmap Planned for a future release

Comments

@lovromazgon
Copy link
Member

lovromazgon commented Feb 11, 2022

Feature description

If we have a source plugin producing records faster than a destination plugin can process them, we need to ensure that we apply back-pressure and throttle down the speed of records being produced.

Using plugins in the built-in mode is not a problem, because we are using channels to send/receive records to/from the plugin. We control the size of the buffer in those channels (currently unbuffered) and back-pressure will automatically be applied.

It's more complicated in standalone mode. Connector plugins are communicating with Conduit via gRPC streams when running in standalone mode. Conduit does not wait for a record to be successfully processed by the destination plugin before sending the next record into the stream, instead, it allows the plugin to asynchronously process the records and send back an acknowledgment once it is done. gRPC by default dynamically changes the buffer size based on bandwidth estimation. Since the plugin is running on the same machine as Conduit latency will be near 0 and bandwidth will be very high, so we can assume that the buffer will grow to the maximum, which is 4MB. Because we have 2 plugins on a pipeline (source and destination) a pipeline can thus buffer 8MB of records before it starts applying back-pressure, which sounds quite a lot (e.g. in case a record is 1kB in size that equals 8000 records).

A solution to this would be to set the initial window size of a gRPC stream to a fixed size. The question is what size would make sense? We should investigate this further and possibly set a fixed window size once we have benchmarks set up (#198) and can measure how that impacts the performance of Conduit.

@lovromazgon lovromazgon added feature New feature or request triage Needs to be triaged labels Feb 11, 2022
@lovromazgon lovromazgon added this to the Future milestone Feb 11, 2022
@lovromazgon lovromazgon removed the triage Needs to be triaged label Feb 11, 2022
@neovintage neovintage added the roadmap Planned for a future release label Feb 18, 2022
@freeformz
Copy link

Related: golang/go#28732

@raulb raulb removed this from the Future milestone Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request roadmap Planned for a future release
Projects
Status: No status
Development

No branches or pull requests

4 participants