43 |
if ($r->{failcnt} > 0) { |
if ($r->{failcnt} > 0) { |
44 |
if ( ($r->{held} / $r->{limit}) > $increase_over ) { |
if ( ($r->{held} / $r->{limit}) > $increase_over ) { |
45 |
my $new_limit = int($r->{limit} * 1.1); |
my $new_limit = int($r->{limit} * 1.1); |
46 |
# warn "# $vmid $res $r->{limit} -> $new_limit\n"; |
my $new_barr = int($r->{limit} * 1.2); |
47 |
print "vzctl set $vmid --${res} $new_limit\n"; |
warn "# $vmid $res $r->{limit} -> $new_limit:$new_barr\n"; |
48 |
|
my $cmd = "vzctl set $vmid --${res} $new_limit:$new_barr --save"; |
49 |
|
warn $cmd,$/; |
50 |
|
system $cmd; |
51 |
} else { |
} else { |
52 |
warn sprintf("%s/%s failed, but not used %d%% [%d/%d %d%%]\n", |
warn sprintf("%s/%s failed, but not used %d%% [%d/%d %d%%]\n", |
53 |
$vmid, $res, $increase_over * 100, $r->{held}, $r->{limit}, ($r->{held}/$r->{limit})*100 |
$vmid, $res, $increase_over * 100, $r->{held}, $r->{limit}, ($r->{held}/$r->{limit})*100 |