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

outbuf_high_watermark #242

Merged
merged 6 commits into from Apr 6, 2019

Conversation

Projects
None yet
2 participants
@mmerickel
Copy link
Member

commented Apr 2, 2019

Fixes #67.

The outbuf_high_watermark is a setting that can be used to apply backpressure on the app_iter if it is yielding data faster than can be written to the client. When the socket falls behind, the app_iter will not resume until the socket catches up to at least the watermark (this does not mean the socket is caught up, just that it's not so far behind).

@mmerickel mmerickel force-pushed the outbuf-high-watermark branch from 0329dab to b9dbed8 Apr 2, 2019

Show resolved Hide resolved waitress/channel.py Outdated
Show resolved Hide resolved waitress/channel.py Outdated

@mmerickel mmerickel force-pushed the outbuf-high-watermark branch 2 times, most recently from ba55660 to 908573f Apr 3, 2019

@mmerickel mmerickel marked this pull request as ready for review Apr 4, 2019

@mmerickel mmerickel force-pushed the outbuf-high-watermark branch 2 times, most recently from 5722d8e to 6534d80 Apr 4, 2019

@mmerickel mmerickel force-pushed the outbuf-high-watermark branch from 6534d80 to 7268909 Apr 5, 2019

@mmerickel mmerickel force-pushed the outbuf-high-watermark branch from 7268909 to b4df005 Apr 5, 2019

Show resolved Hide resolved waitress/channel.py Outdated

bertjwregeer and others added some commits Apr 5, 2019

clarify comment on len() issues
Co-Authored-By: mmerickel <github@m.merickel.org>

@mmerickel mmerickel force-pushed the outbuf-high-watermark branch from b9d0a3e to 291f8e1 Apr 5, 2019

@bertjwregeer
Copy link
Member

left a comment

Looks great, minor nitpicks.

Show resolved Hide resolved waitress/channel.py Outdated
Show resolved Hide resolved waitress/channel.py
# that we need to account for, otherwise it'd be better
# to do this check at the start of the request instead of
# at the end to account for consecutive service() calls
if len(self.requests) > 1:

This comment has been minimized.

Copy link
@bertjwregeer

bertjwregeer Apr 6, 2019

Member

Would it make sense here to kick the trigger?

This comment has been minimized.

Copy link
@mmerickel

mmerickel Apr 6, 2019

Author Member

I'm not familiar with the scenarios in which kicking the trigger is required.

This comment has been minimized.

Copy link
@mmerickel

mmerickel Apr 6, 2019

Author Member

It's not like the current behavior is worse than it was before. I would assume the situation is that the write returned 0 bytes written because the buffer was full, and the system would know that more data is writable before hitting a select timeout or something. If you think it's a problem then it should be kicked in _flush_outbufs_below_high_watermark which affects both app_iter writes as well as here between requests. I can't imagine the circumstances are different here than there.

@bertjwregeer bertjwregeer merged commit 5583715 into master Apr 6, 2019

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@bertjwregeer bertjwregeer deleted the outbuf-high-watermark branch Apr 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.