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

Implement a no-list strategy for wal-restore to improve recovery times #877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjuls
Copy link
Contributor

@sjuls sjuls commented Dec 1, 2023

Hi @mikewallace1979,

I have another proposal for improving wal-restore download times. This proposal eliminates the list operation in favour of optimistically trying to download the wal file, going through supported compressions and falling back to non-compressed variant.

Since list object operations are quite expensive (eg it's 10x the price of a Get on AWS) and also subject to more variance in performance, this change should be both cheaper and yield a shorter and more consistent download time for all use-cases.

I've run a small experiment to verify whether no-list has the desired effect, and it seems to yield an overall better and more consistent result in my current configuration and cloud provider.

Number of seconds spent to download wal-files - measurements taken against Azure with snappy compression;

  List source_dir List wal_path (#876) Optimistic no-list
min 6.602070531 4.466363753 4.252058976
max 17.18391819 15.12628784 7.055532052
avg 9.149752375 6.924325793 5.208105985
median 7.51357695 5.796609713 5.204032868
stdev 3.429938044 3.265527009 0.6495604517

I don't have a good way to test the changes against all cloud provider, hope you can assist me here in some fashion.

Let me know what you think.

@mikewallace1979
Copy link
Contributor

Hi @sjuls - according to the data this looks ilke a worthwhile optimisation!

I wonder if it might also be worth adding an CLI argument, so for cases where the same compression type has been used throughout the archive's lifetime you can specify that compression in the restore_command and Barman will always try that compression first.

I can test this against the remaining two cloud providers though I'm not sure much time I can commit to it this week. If we were to merge this we'll add some corresponding integration tests - unfortunately the integration tests are not public so that's something that'll have to happen behind the scenes for now.

@gcalacoci what do you think about the general idea here?

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