Skip to content

Commit 1279a46

Browse files
committed
Fine-tuning the write-buffer proxy
1 parent 37bbd3a commit 1279a46

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opencog/persist/proxy/WriteBufferProxy.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,18 @@ void WriteBufferProxy::write_loop(void)
385385
// I guess we're good. Relax the high-water mark a bit.
386386
if (_high_water_mark < HIMAX)
387387
{
388-
_high_water_mark *= 5;
389-
_high_water_mark /= 4;
388+
_high_water_mark *= 17;
389+
_high_water_mark /= 16;
390390
}
391391
}
392392
else
393393
{
394394
// Oh no! Cannot keep up with the requested time limit!
395395
// Pause readers until the queue drains down a bit.
396+
// _mavg_out is how many we are able to actually write,
397+
// per ticker. Scaling sets a buffer size that should
398+
// be able to clear at exactly that rate. So this should
399+
// be able to hold the duty cycle to 1.0 as the mean value.
396400
nappy = 0;
397401
left = 0.0;
398402
double worst = fmax(_mavg_out_atoms, _mavg_out_values);

0 commit comments

Comments
 (0)