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

Add --preallocate to rsync options #651

Closed
graemes opened this issue May 24, 2021 · 11 comments
Closed

Add --preallocate to rsync options #651

graemes opened this issue May 24, 2021 · 11 comments
Labels
enhancement New feature or request

Comments

@graemes
Copy link
Contributor

graemes commented May 24, 2021

Please add --preallocate to the options for rsync.

With file-systems that support fallocate (most modern ones - tested with btrfs) it pre-reserves the space required for the plot.

This has two benefits when using multiple plotters against a single drive:
a) minimises fragmentation when interleaving writes
b) and also flags up out of space situation immediately on first to be last writer.

@graemes graemes added the enhancement New feature or request label May 24, 2021
@randellhodges
Copy link

Nice. I didn't even know about that option. Out of curiosity, how much delay does that add before the transfer starts? I need to do more research into that (using ext4 myself)

@graemes
Copy link
Contributor Author

graemes commented May 24, 2021

On my quick test seemed to be approx. 30 seconds before the space was registered through df but conversely the transfer felt faster (I'm using btrfs and 10G). YMMV.
Interestingly - if you do a ls -larth on the destination directory the actual size of the file is incremented reflecting the actual transfer.

@graemes
Copy link
Contributor Author

graemes commented May 24, 2021

FYI - rsync usies fallocate under the hood: https://www.linux.org/docs/man1/fallocate.html

@syadnom
Copy link

syadnom commented May 26, 2021

upvote.

@randellhodges
Copy link

I added this option to my rsync command a couple days ago, and while I haven't paid enough attention to see if made anything better, I haven't seen any problems since adding.

@syadnom
Copy link

syadnom commented May 26, 2021

randellhodges, which file in plotman did you mod (I'm lazy, save me a minute of searching ;) )

@syadnom
Copy link

syadnom commented May 26, 2021

I'm using aufs set to write to the drive with the most free space, so pre-allocating is key to balancing target drives out in the sync process.

@randellhodges
Copy link

randellhodges, which file in plotman did you mod (I'm lazy, save me a minute of searching ;) )

Speaking of lazy, I just modified the file from the official pip install. Yup, I know this isn't the best way of doing it, but it was quick and easy. Just remember that if you are running plotman to stop and start it again.

/home/chia/chia-blockchain/venv/lib/python3.8/site-packages/plotman/archive.py

Replace /home/chia/chia-blockchain/venv with whatever folder the python virtual environment installed into.

@syadnom
Copy link

syadnom commented May 26, 2021

thanks. I'll experiment with you too

@graemes
Copy link
Contributor Author

graemes commented May 30, 2021

From the comments in #565 it seems that the system version of rsync on the mac is missing the --preallocate option due to it's age.

@graemes graemes closed this as completed Jun 10, 2021
@graemes
Copy link
Contributor Author

graemes commented Jun 10, 2021

Already added in 0.4 but can be added independently anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants