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

posix_fallocate extremely slow on ext3 file system #653

Open
LakshK98 opened this issue May 14, 2024 · 1 comment
Open

posix_fallocate extremely slow on ext3 file system #653

LakshK98 opened this issue May 14, 2024 · 1 comment

Comments

@LakshK98
Copy link

LakshK98 commented May 14, 2024

posix_fallocate is extremely slow on ext3 file system (~12s for 8mb file) when file is opened with O_DSYNC flag.
This causes overall slowdown in dqlite execution when log/snapshot files are to be written. For instance, the average response time per request increases from 5ms for 1000 requests to a sluggish 25ms for 10,000 requests on our 3 node cluster setup.

I tried manualling setting fallocate to false in uv_fs.c here so that the fallocate emulation logic is executed. This reduces avg response time for 10k requests to around 5-6 ms.

Would it possible to set fallocate to false on ext3 file systems in probeFallocate?

@cole-miller
Copy link
Contributor

cole-miller commented May 21, 2024

Sorry for the delayed response. This is unfortunate, but I'm hesitant to add (more) carveouts for specific filesystems to our code---especially for ext3, which (aiui) has been superseded by ext4. Maybe we should just add a general mechanism, like an environment variable, for dynamically overriding dqlite's decision to use fallocate, etc. (But this has security implications: if you can control this environment variable you can control dqlite's performance.)

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

No branches or pull requests

2 participants