From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH guest-common 1/1] vzdump: add 'performance' property string as a setting
Date: Mon, 3 Oct 2022 15:52:05 +0200 [thread overview]
Message-ID: <20221003135211.183340-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20221003135211.183340-1-f.ebner@proxmox.com>
Initially, to be used for tuning backup performance with QEMU.
A few users reported IO-related issues during backup after upgrading
to PVE 7.x and using a modified QEMU build with max-workers reduced to
8 instead of 16 helped them [0].
Also generalizes the way vzdump property string are handled for easier
extension in the future.
[0]: https://forum.proxmox.com/threads/113790/
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/VZDump/Common.pm | 42 ++++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/src/PVE/VZDump/Common.pm b/src/PVE/VZDump/Common.pm
index cb46de1..8b8b75a 100644
--- a/src/PVE/VZDump/Common.pm
+++ b/src/PVE/VZDump/Common.pm
@@ -29,16 +29,21 @@ my $dowhash_to_dow = sub {
return join ',', @da;
};
-my $fixup_prune_backups_option = sub {
+our $PROPERTY_STRINGS = {
+ 'performance' => 'backup-performance',
+ 'prune-backups' => 'prune-backups',
+};
+
+my sub parse_property_strings {
my ($opts) = @_;
- return if !defined($opts->{'prune-backups'});
+ for my $opt (keys $PROPERTY_STRINGS->%*) {
+ next if !defined($opts->{$opt});
- $opts->{'prune-backups'} = PVE::JSONSchema::parse_property_string(
- 'prune-backups',
- $opts->{'prune-backups'}
- );
-};
+ my $format = $PROPERTY_STRINGS->{$opt};
+ $opts->{$opt} = PVE::JSONSchema::parse_property_string($format, $opts->{$opt});
+ }
+}
# parse crontab style day of week
sub parse_dow {
@@ -71,6 +76,17 @@ sub parse_dow {
return $res;
};
+PVE::JSONSchema::register_format('backup-performance', {
+ 'max-workers' => {
+ description => "Applies to VMs. Allow up to this many IO workers at the same time.",
+ type => 'integer',
+ minimum => 1,
+ maximum => 256,
+ default => 16,
+ optional => 1,
+ },
+});
+
my $confdesc = {
vmid => {
type => 'string', format => 'pve-vmid-list',
@@ -196,6 +212,12 @@ my $confdesc = {
maximum => 8,
default => 7,
},
+ performance => {
+ type => 'string',
+ description => "Other performance-related settings.",
+ format => 'backup-performance',
+ optional => 1,
+ },
lockwait => {
type => 'integer',
description => "Maximal time to wait for the global lock (minutes).",
@@ -311,7 +333,7 @@ sub parse_vzdump_cron_config {
$opts->{starttime} = sprintf "%02d:%02d", $hour, $minute;
$opts->{dow} = &$dowhash_to_dow($dowhash);
- $fixup_prune_backups_option->($opts); # parse the property string
+ parse_property_strings($opts);
push @$jobs, $opts;
};
@@ -402,8 +424,8 @@ sub command_line {
}
} else {
$v = join(",", PVE::Tools::split_list($v)) if $p eq 'mailto';
- $v = PVE::JSONSchema::print_property_string($v, 'prune-backups')
- if $p eq 'prune-backups';
+ $v = PVE::JSONSchema::print_property_string($v, $PROPERTY_STRINGS->{$p})
+ if $PROPERTY_STRINGS->{$p};
$cmd .= " --$p " . PVE::Tools::shellquote($v) if defined($v) && $v ne '';
}
--
2.30.2
next prev parent reply other threads:[~2022-10-03 13:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 13:52 [pve-devel] [PATCH-SERIES qemu(-server)/guest-common/manager/docs] make QEMU's max-workers setting configurable as a vzdump setting Fiona Ebner
2022-10-03 13:52 ` [pve-devel] [PATCH qemu 1/1] PVE Backup: allow passing max-workers performance setting Fiona Ebner
2022-10-10 10:54 ` [pve-devel] applied: " Wolfgang Bumiller
2022-10-03 13:52 ` Fiona Ebner [this message]
2022-10-03 13:52 ` [pve-devel] [PATCH qemu-server 1/1] vzdump: set max-workers QMP option when specified and supported Fiona Ebner
2022-10-03 13:52 ` [pve-devel] [PATCH manager 1/1] vzdump: handle new 'performance' property string Fiona Ebner
2022-10-03 13:52 ` [pve-devel] [PATCH docs 1/4] backup: rework storage section, mentioning and recommending PBS Fiona Ebner
2022-10-03 13:52 ` [pve-devel] [PATCH docs 2/4] backup: expand section for jobs Fiona Ebner
2022-10-03 13:52 ` [pve-devel] [PATCH docs 3/4] backup: merge sections describing jobs Fiona Ebner
2022-10-03 13:52 ` [pve-devel] [PATCH docs 4/4] backup: mention max-workers performance setting Fiona Ebner
2022-10-10 11:10 ` [pve-devel] applied-series: [PATCH-SERIES qemu(-server)/guest-common/manager/docs] make QEMU's max-workers setting configurable as a vzdump setting Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221003135211.183340-3-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox