-
Notifications
You must be signed in to change notification settings - Fork 358
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
feature: improve read / write performance #482
Open
aoblet
wants to merge
3
commits into
RsyncProject:master
Choose a base branch
from
aoblet:feature/perf-io
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+46
−7
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,8 @@ int checksum_seed = 0; | |
int inplace = 0; | ||
int delay_updates = 0; | ||
int32 block_size = 0; | ||
int max_map_size = 256*1024; | ||
int write_size = 32*1024; | ||
time_t stop_at_utime = 0; | ||
char *skip_compress = NULL; | ||
char *copy_as = NULL; | ||
|
@@ -740,6 +742,8 @@ static struct poptOption long_options[] = { | |
{"checksum-choice", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 }, | ||
{"cc", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 }, | ||
{"block-size", 'B', POPT_ARG_STRING, 0, OPT_BLOCK_SIZE, 0, 0 }, | ||
{"max-map-size", 0, POPT_ARG_INT, &max_map_size, 0, 0, 0 }, | ||
{"write-size", 0, POPT_ARG_INT, &write_size, 0, 0, 0 }, | ||
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, | ||
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, | ||
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, | ||
|
@@ -2772,7 +2776,19 @@ void server_options(char **args, int *argc_p) | |
args[ac++] = arg; | ||
} | ||
|
||
if (io_timeout) { | ||
if (max_map_size) { | ||
if (asprintf(&arg, "--max-map-size=%d", max_map_size) < 0) | ||
goto oom; | ||
args[ac++] = arg; | ||
} | ||
|
||
if (write_size) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same issue as max_map_size |
||
if (asprintf(&arg, "--write-size=%d", write_size) < 0) | ||
goto oom; | ||
args[ac++] = arg; | ||
} | ||
|
||
if (io_timeout) { | ||
if (asprintf(&arg, "--timeout=%d", io_timeout) < 0) | ||
goto oom; | ||
args[ac++] = arg; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,6 +472,8 @@ has its own detailed description later in this manpage. | |
--checksum-choice=STR choose the checksum algorithm (aka --cc) | ||
--one-file-system, -x don't cross filesystem boundaries | ||
--block-size=SIZE, -B force a fixed checksum block-size | ||
--max-map-size=SIZE force mmap read block size (expressed in bytes, useful for fast storage, default 256K) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be easier to use in kBytes? |
||
--write-size=SIZE force write block size (expressed in bytes, default 32K) | ||
--rsh=COMMAND, -e specify the remote shell to use | ||
--rsync-path=PROGRAM specify the rsync to run on remote machine | ||
--existing skip creating new files on receiver | ||
|
@@ -2125,6 +2127,25 @@ expand it. | |
Beginning in 3.2.3 the SIZE can be specified with a suffix as detailed in | ||
the [`--max-size`](#opt) option. Older versions only accepted a byte count. | ||
|
||
0. `--max-map-size=SIZE` | ||
|
||
On fast storage, reading with a specific block size can drastically improve | ||
fetch performance. This option acts as length mmap argument. | ||
|
||
On scale-out or flash disk storage, this value can be set higher than 1MB. | ||
|
||
By default, 256K and expressed in Bytes. | ||
|
||
To use 4K read block size: | ||
> --max-map-size 4194304 | ||
|
||
|
||
0. `--write-size=SIZE` | ||
|
||
This option forces the buffer size when writing a file on the receiver side. | ||
|
||
By default, 32K and expressed in Bytes. | ||
|
||
0. `--rsh=COMMAND`, `-e` | ||
|
||
This option allows you to choose an alternative remote shell program to use | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we will need a MAX_MAP_SIZE_DEFAULT define, and make this check be if (max_map_size != MAX_MAP_SIZE_DEFAULT)
otherwise we will be sending this option always, and the remove rsync may not understand it, so would break a lot of setups