From 7b14ba94881f505a0090bb158187f18f0788dbcf Mon Sep 17 00:00:00 2001 From: Ryan Tucker Date: Tue, 16 Mar 2010 11:25:50 -0400 Subject: [PATCH] tweaking the congestion handler a bit --- BackupPC_archiveHost_s3 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BackupPC_archiveHost_s3 b/BackupPC_archiveHost_s3 index be69e54..a1e7130 100755 --- a/BackupPC_archiveHost_s3 +++ b/BackupPC_archiveHost_s3 @@ -120,8 +120,9 @@ class SlowFile: else: # we're late; something got slow. lateness = starttime - self.lastblocktargettime - self.delayfactor += min(0.5, lateness) - logger.debug('%.2f seconds late (congestion?); setting delayfactor to %.2f' % (lateness, self.delayfactor)) + if lateness > 0.2: + self.delayfactor += min(0.5, lateness) + logger.debug('%.2f seconds late (congestion?); setting delayfactor to %.2f' % (lateness, self.delayfactor)) targetspeed = self.speed/float(self.delayfactor) self.lastblocktargettime = time.time() + len/float(targetspeed) @@ -129,7 +130,7 @@ class SlowFile: if time.time() > self.lastdebug+60: if self.delayfactor > 1: # reduce the penalty a bit - self.delayfactor -= 0.1 + self.delayfactor -= 0.2 targetspeed = self.speed/float(self.delayfactor) self.lastblocktargettime = time.time() + len/float(targetspeed)