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

Better RequestProcessor pipeline #302

Open
lzydmxy opened this issue Jun 13, 2024 · 0 comments · May be fixed by #314
Open

Better RequestProcessor pipeline #302

lzydmxy opened this issue Jun 13, 2024 · 0 comments · May be fixed by #314
Labels
performance Performance promotion

Comments

@lzydmxy
Copy link
Contributor

lzydmxy commented Jun 13, 2024

The current RequestProcessor pipeline can be roughly abstracted into the following three steps:

while (true)
{
    1.move request from requests_queue to pending_queue
    2.do read from all pending_queue until got write request
    3.handle commit_requests
}

The current pipeline has two problems:

  1. A high read batch size will delay commit processing
    2.Read requests can also delay. Imagine we have a session with a write request and a read request. In the step third, we process the write request . After that, we move to step one, If there are a large count of read requests from other sessions, it can cause the read request in this session to be suspended for a long time.

Describe your idea

New pipeline

while (1)
{
    1.move request from requests_queue to pending_queue(if got any write request), or just do read async parallelism (until reach maxReadBatchSize)
    2.wait all read done
    3.handle commit_requests, and need_drain.push_back(commit_requests.session_id)
    4.handle need_drain sessions, do read async parallelism
}
  1. We need max number of reads to process from queuedRequests before switching to processing commits
  2. When handling commit requests, record the corresponding session ID so that we can promptly address the read requests that are suspended due to the write requests.
  3. Do readings async parallelism
@lzydmxy lzydmxy added the performance Performance promotion label Jun 13, 2024
@JackyWoo JackyWoo added this to the Release v2.1.1 milestone Jun 13, 2024
@lzydmxy lzydmxy linked a pull request Jun 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance promotion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants