Skip to content

chore(v2): block reader synchronous execution #4122

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

Merged
merged 1 commit into from
Apr 21, 2025

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Apr 20, 2025

We currently rely on an adaptive concurrency limiter with gradient-based control to prevent exhausting the resources of query backend instances. While it generally works well, not all queries are equal or comparable, which is necessary for the limiter to be effective. Moreover, intra-block concurrency (e.g., between datasets) introduces significant error into the logic, as resource marshalling increases.

This is a minor change aimed at preventing query backend instances from running OOM: we now synchronize dataset processing. In practice, this means that a query spanning multiple tenant services will process them sequentially within the block context. The vast majority of queries target a single dataset. For the rest, no performance degradation is expected, as most queries are CPU-bound, and concurrency across dataset contexts can actually do more harm than good.

In the future, we should implement proper fair resource allocation management, which will also include admission control.

Even if the query does not have any bounds (such as label filters), the memory consumption is bound by the concurrency we define in the query plan (currently, it's hardcoded to 4):

image

@kolesnikovae kolesnikovae requested a review from a team as a code owner April 20, 2025 05:32
@kolesnikovae kolesnikovae force-pushed the chore/block-reader-concurrency branch from 0632146 to 74c7f9b Compare April 21, 2025 02:41
@kolesnikovae kolesnikovae merged commit c5aae6a into main Apr 21, 2025
20 checks passed
@kolesnikovae kolesnikovae deleted the chore/block-reader-concurrency branch April 21, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants