Skip to content

Commit

Permalink
Limit queue increase to PHI*current. Add msg to computeNewQueueSize.
Browse files Browse the repository at this point in the history
  • Loading branch information
semmerson committed Nov 10, 2023
1 parent 241d909 commit 440c5f9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGE_LOG
@@ -1,3 +1,8 @@
6.15.0.12
ldmadmin(1):
* Modified "vetqueuesize" to limit queue expansion to Golden Ratio times current size
parameters

6.15.0.11 2023-10-10T09:43:40-0600
pqinsert(1):
* Added "-r" option to read the input files instead of memory-mapping them. This might be
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -2,7 +2,7 @@ dnl Process this file with automake to produce a configure script
dnl Requires ./aclocal.m4
dnl
AC_PREREQ([2.69])
AC_INIT([LDM],[6.15.0.11],[support-ldm@unidata.ucar.edu],[],[http://www.unidata.ucar.edu/software/ldm])
AC_INIT([LDM],[6.15.0.12],[support-ldm@unidata.ucar.edu],[],[http://www.unidata.ucar.edu/software/ldm])

AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([config.h.in])
Expand Down
23 changes: 15 additions & 8 deletions scripts/ldmadmin.pl.in
Expand Up @@ -1186,14 +1186,17 @@ sub computeNewQueueSize
my $mvrtSize = $_[2];
my $mvrtSlots = $_[3];

errmsg("computeNewQueueSize(): MVRT=$minVirtResTime s, ageOldest=$oldestProductAge s".
", mvrtSize=$mvrtSize, mvrtSlots=$mvrtSlots");

if (0 >= $minVirtResTime) {
# Use age of oldest product, instead
$minVirtResTime = $oldestProductAge;
}
my $newByteCount;
my $newSlotCount;
if (0 < $minVirtResTime) {
my $ratio = $max_latency/$minVirtResTime;
my $ratio = double($max_latency)/double($minVirtResTime);
$newByteCount = int($ratio*$mvrtSize);
$newSlotCount = int($ratio*$mvrtSlots);
}
Expand Down Expand Up @@ -1235,11 +1238,13 @@ sub vetQueueSize
}
else {
my @params = split(/\s+/, $line);
my $isFull = $params[0];
my $ageOldest = $params[7];
my $minVirtResTime = $params[9];
my $mvrtSize = $params[10];
my $mvrtSlots = $params[11];
my $isFull = $params[0]; # Has the oldest product been deleted to make room?
my $byteCap = $params[1]; # Queue capacity in bytes
my $prodCap = $params[4]; # Queue capacity in products
my $ageOldest = $params[7]; # Age of the oldest product in seconds
my $minVirtResTime = $params[9]; # MVRT in seconds since queue creation
my $mvrtSize = $params[10]; # Number of bytes in queue when MVRT set
my $mvrtSlots = $params[11]; # Number of products in queue when MVRT set

if (!$isFull || $minVirtResTime < 0
|| $minVirtResTime >= $max_latency
Expand All @@ -1265,8 +1270,10 @@ sub vetQueueSize
if ($reconMode eq $increaseQueue) {
my @newParams = computeNewQueueSize($minVirtResTime,
$ageOldest, $mvrtSize, $mvrtSlots);
my $newByteCount = $newParams[0];
my $newSlotCount = $newParams[1];
# Limit the increase
my $newByteCount = min($newParams[0], int($byteCap*1.618));
my $newSlotCount = min($newParams[1], int($prodCap*1.618));

my $newQueuePath = "$pq_path.new";

errmsg("vetQueueSize(): Increasing the capacity of the ".
Expand Down

0 comments on commit 440c5f9

Please sign in to comment.