CPU priority reduced when compressing
gitea/vn-vmware/pipeline/head This commit looks good
Details
gitea/vn-vmware/pipeline/head This commit looks good
Details
This commit is contained in:
parent
5c049af5ac
commit
db07203605
|
@ -1,4 +1,4 @@
|
|||
vn-vmware (1.1.20) stable; urgency=low
|
||||
vn-vmware (1.1.21) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ sub backup_machine() {
|
|||
if (exists $config{pigz_processes}) {
|
||||
$pigz_processes = $config{pigz_processes};
|
||||
} else {
|
||||
$pigz_processes = int(Sys::CPU::cpu_count()) - 2;
|
||||
$pigz_processes = int(Sys::CPU::cpu_count());
|
||||
}
|
||||
|
||||
$pigz_processes = max(1, $pigz_processes);
|
||||
|
@ -618,12 +618,17 @@ sub backup_machine() {
|
|||
log_message "Compressing with Gzip (using $pigz_processes processes) to TAR file.";
|
||||
log_message $tar_command;
|
||||
|
||||
my $priority = getpriority(0, 0);
|
||||
setpriority(0, 0, $priority + 10);
|
||||
|
||||
unless ($test) {
|
||||
my $tar_status = system($tar_command);
|
||||
unless ($tar_status == 0) {
|
||||
die "An error occurred when trying to compress '$vm_name' machine files.";
|
||||
}
|
||||
}
|
||||
|
||||
setpriority(0, 0, $priority);
|
||||
};
|
||||
|
||||
my $err = $@;
|
||||
|
|
Reference in New Issue