Skip to content

Set read_ahead_kb to 20MB (configurable)#49

Open
djahandarie wants to merge 1 commit intoMaterializeInc:mainfrom
djahandarie:read_ahead_kb
Open

Set read_ahead_kb to 20MB (configurable)#49
djahandarie wants to merge 1 commit intoMaterializeInc:mainfrom
djahandarie:read_ahead_kb

Conversation

@djahandarie
Copy link
Contributor

@djahandarie djahandarie commented Dec 7, 2025

Set read_ahead_kb to 20MB (configurable) (up from Linux default of 128KB) for all detected devices.

  • Linux has many heuristics for deciding when to read ahead. It will generally only do it when it has detected some sort of sequential reading behavior, or when madvise'd to read sequentially. Hopefully, this PR will not cause large issues on non-sequential workloads.
  • Materialize does lots of sequential reading, so hopefully this will lead to benefits when the kernel detects sequential reading. We have seen on some of our workloads that we are being bottlenecked probably on serialization of disk reads / lack of pipelining.

I'm not so sure exactly how effective this will be when swap is getting striped across multiple disks, but it seems worth trying.

This PR is untested, and the exact value may need tuning.

Copy link
Contributor

@alex-hunt-materialize alex-hunt-materialize left a comment

Choose a reason for hiding this comment

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

Code LGTM, but CC @antiguru for performance expectations.

@djahandarie
Copy link
Contributor Author

I think it's fine to hold on merging this, as I have not been able to get a notable performance boost from it. This will probably eventually be useful but I think it's not yet the bottleneck...

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