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

[WIP] Add background thread and caching of consumers to Kafka SDF #31786

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

scwhittle
Copy link
Contributor

Attempt to improve SDF throughput to UnboundedReader impl by similarly performing blocking kafka polls in background thread and is cached.
This allows main partition consuming thread to be blocked less, prefetches, and caching reduces consuemr connections.

Remaining work:

  • figure out how to address when a read is stopped due to splitting. Currently records that were pulled off of background queue are lost. Could perhaps be added back to the background queue in some way or we could change the interface to internally vend a record at a time and keep track of if it is consumed or not.
  • unit testing and performance testing
  • some of the timeout configuration plumbing needs to be fixed

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@scwhittle
Copy link
Contributor Author

R: @bzablocki

Copy link
Contributor

github-actions bot commented Jul 5, 2024

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@scwhittle scwhittle force-pushed the background_poll branch 3 times, most recently from 671a8a4 to 73cda8a Compare July 6, 2024 00:11
@bzablocki
Copy link
Contributor

Thanks, Sam! I tested this change, and it seems to make the throughput "smoother", but not necessarily higher. The average throughput remains about the same.
image

@scwhittle
Copy link
Contributor Author

Thanks for testing Bartosz! I'll clean it up and add tests. I think it will be helpful for preventing the high # of consumer creations which I believe was affecting some kafka sdf users.

Copy link
Contributor

github-actions bot commented Oct 4, 2024

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 4, 2024
@bzablocki
Copy link
Contributor

I'm continuing the work on this in my PR (#32597).

@github-actions github-actions bot removed the stale label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants