Skip to content

refactor(inkless): pipelining committer threading #300

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jeqo
Copy link
Contributor

@jeqo jeqo commented May 19, 2025

At the moment, the threads are managed by the jobs. Specially, the commit job blocks on upload future.
Instead we can use CompletableFuture to compose the thread coordination. This should help with better resource utilization.

jeqo added 3 commits May 19, 2025 08:47
Instead of running this as a separate thread, run directly on the same
thread as it is not an IO task.
Reduces thread allocation.
Cached thread polls are unbounded. As concurrent uploads wait for
commits to complete, the amound of uploads can grow without limits,
affecting cpu utilization and increasing latencies.
To bound the uploads to the expected commit latencies, this PR proposes
to use fixed thread pool (8 by default) to be able to upload up to 8
files concurrently, these uploads have a P99 of 400ms on S3.
As sequential commits can have a P99 of 50ms on PG, having 8 commits
queued would already account for doubling the upload time.
This is an initial estimation and the values could be updated and the
defaults changed as this setup is tested; but having configurable thread
pools should benefit in the long term.
At the moment, the threads are managed by the jobs. Specially, the
commit job blocks on upload future.
Instead we can use CompletableFuture to compose the thread coordination.
This should help with better resource utilization.
@jeqo
Copy link
Contributor Author

jeqo commented May 19, 2025

WriteIntegrationTest is getting flaky which may indicate the proposed approach is breaking ordering on the response. Have to look a bit deeper into this.

Base automatically changed from jeqo/fixed-thread-pools to jeqo/refactor-append-completer May 22, 2025 08:53
Base automatically changed from jeqo/refactor-append-completer to main May 22, 2025 09:00
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.

1 participant