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

perf: high read amplification #4377

Open
Tracked by #4754
skyzh opened this issue May 30, 2023 · 4 comments
Open
Tracked by #4754

perf: high read amplification #4377

skyzh opened this issue May 30, 2023 · 4 comments
Labels
c/storage/pageserver Component: storage: pageserver

Comments

@skyzh
Copy link
Member

skyzh commented May 30, 2023

Steps to reproduce

Expected result

Actual result

Given that we never merge existing delta layers, if a page is updated multiple times throughout a long time, the read cost of reconstructing the page would be high. Currently it would be reading 6 files on average and 20 files p99 to reconstruct a page.

image

This would be resolved as a long-term task as in #4359

Environment

Logs, links

@skyzh skyzh added t/bug Issue Type: Bug c/storage/pageserver Component: storage: pageserver and removed t/bug Issue Type: Bug labels May 30, 2023
@akashmahalik
Copy link

Sorry if I am asking dumb questions !

Is the page getting updated in-place
OR

  1. A new page is created by reading the existing one. (Isn't the existing page indexed ?)
  2. Update stuff in the page.
  3. Point it to the new page.

Can you please clarify if the read amplification is the one I mentioned in Point No. 1 ?

What do you mean by reading files in this case ?

@skyzh
Copy link
Member Author

skyzh commented May 31, 2023

It is like the latter one but not exactly. Reads involve finding all deltas and the base image, and reconstruct the latest page content.

@akashmahalik
Copy link

akashmahalik commented Jun 1, 2023

I read through the compaction epic and seems like the compaction isn’t done yet and we are trying to reconstruct the page by reading all the small files.

I have few questions

  1. Do you have an index (sparse index -> key : byte offset) as metadata with a fixed size beginning of the file ? More like pointing to a block within a file. Future optimisation : that block can be compressed to reduce I/O bandwidth.
  2. Might be possible the read amplification are just false positives where you go through all the files just to find nothing. Maybe a bloom filter might help in this case.

@skyzh
Copy link
Member Author

skyzh commented Jun 1, 2023

Yes. Reading bloom filter is still costly in I/O.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/storage/pageserver Component: storage: pageserver
Projects
None yet
Development

No branches or pull requests

2 participants