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

use task groups for concurrent queue consumers #16850

Merged
merged 13 commits into from
Jan 29, 2025
Merged

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Jan 24, 2025

related to #16299

  • use task groups to consume items off the in-memory queue concurrently (2 concurrent consumers appears to roughly double the rate of clearing the queue)
  • add debug queue depth metrics

the queue depth metrics were very useful while debugging and I could imagine they might be useful to server operators in the future, which I why I opted to keep it in - happy to re-evaluate this choice. doing so made me think that we may want to add more server metrics in the future

Copy link

codspeed-hq bot commented Jan 24, 2025

CodSpeed Performance Report

Merging #16850 will not alter performance

Comparing statement-timeout (719f7ec) with main (180185e)

Summary

✅ 2 untouched benchmarks

Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all makes sense to me! The tests look great

Copy link
Contributor

@daniel-prefect daniel-prefect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs changes look good

@zzstoatzz
Copy link
Collaborator Author

Docs changes look good

thanks! though this reminds me that I should have actually removed that new setting, this is removed now so there should be no doc-related changes here

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple nits, but this looks like an awesome enhancement!

src/prefect/server/utilities/messaging/memory.py Outdated Show resolved Hide resolved
src/prefect/server/services/task_run_recorder.py Outdated Show resolved Hide resolved
@desertaxle desertaxle removed the docs label Jan 29, 2025
@zzstoatzz zzstoatzz merged commit 85f58f4 into main Jan 29, 2025
46 checks passed
@zzstoatzz zzstoatzz deleted the statement-timeout branch January 29, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x bug Something isn't working performance Related to an optimization or performance improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants