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

Watermark based backpressure for webserver #3136

Closed
3 tasks done
danielkec opened this issue Jun 20, 2021 · 0 comments · Fixed by #4724
Closed
3 tasks done

Watermark based backpressure for webserver #3136

danielkec opened this issue Jun 20, 2021 · 0 comments · Fixed by #4724
Assignees
Labels
enhancement New feature or request P3 reactive Reactive streams and related components webserver

Comments

@danielkec
Copy link
Contributor

danielkec commented Jun 20, 2021

Investigate use of backpressure for not immediately flushed datachunks as suggested by @olotenko :

Count the bytes that go through here, and allow up to a given amount to be buffered. Eg onNext counts how many bytes were in the buffers it has seen, and requests one more chunk if it has seen below watermark. Then channel.write completion Future subtracts the bytes it has just written. If this results in crossing the "watermark", then request 1. (because onNext stopped requesting more)

Watermarking approach is more predictable. Just deferring to channel.write completion would work poorly, if in the common case socket write completion does not happen during onNext, but will work better than watermarking, if there is this guarantee. (Ie that onNext attempts to call channel.write, through a few calls of intermediate routines, and that Netty completes the future before onNext returns, if the write fully fits in socket send buffers)

#3108 (review)

PR's

@danielkec danielkec self-assigned this Jun 20, 2021
@danielkec danielkec added reactive Reactive streams and related components webserver labels Jun 20, 2021
@m0mus m0mus added enhancement New feature or request P3 labels Jun 24, 2021
danielkec added a commit to danielkec/helidon that referenced this issue Sep 30, 2022
Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
danielkec added a commit to danielkec/helidon that referenced this issue Oct 3, 2022
Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
danielkec added a commit to danielkec/helidon that referenced this issue Oct 3, 2022
Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
romain-grecourt pushed a commit that referenced this issue Oct 3, 2022
Signed-off-by: Daniel Kec <daniel.kec@oracle.com>

Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
romain-grecourt pushed a commit that referenced this issue Oct 3, 2022
Signed-off-by: Daniel Kec <daniel.kec@oracle.com>

Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
romain-grecourt pushed a commit that referenced this issue Oct 3, 2022
Signed-off-by: Daniel Kec <daniel.kec@oracle.com>

Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 reactive Reactive streams and related components webserver
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants