Signed-off-by: Tim Marx <t.m...@proxmox.com> --- PVE/QemuServer/Helpers.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/PVE/QemuServer/Helpers.pm b/PVE/QemuServer/Helpers.pm index fcc9392..86bf3d9 100644 --- a/PVE/QemuServer/Helpers.pm +++ b/PVE/QemuServer/Helpers.pm @@ -11,6 +11,7 @@ use PVE::ProcFSTools; use base 'Exporter'; our @EXPORT_OK = qw( min_version +config_aware_timeout ); my $nodename = PVE::INotify::nodename(); @@ -139,4 +140,24 @@ sub version_cmp { return 0; } +sub config_aware_timeout { + my ($memory, $hugepages, $is_suspended) = @_; + my $timeout = 30; + + # Currently based on user reports + if (defined($memory) && $memory > 30720) { + $timeout = int($memory/1024); + } + + if ($is_suspended && $timeout < 300) { + $timeout = 300; + } + + if ($hugepages && $timeout < 150) { + $timeout = 150; + } + + return $timeout; +} + 1; -- 2.20.1 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel