[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 17 Sep 2002 21:19:19 -0000


matthew		Tue Sep 17 17:19:19 2002 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Fixes to overload caused by lond not doing what we thought it did for 'load'.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.284 loncom/lonnet/perl/lonnet.pm:1.285
--- loncom/lonnet/perl/lonnet.pm:1.284	Tue Sep 17 15:45:11 2002
+++ loncom/lonnet/perl/lonnet.pm	Tue Sep 17 17:19:19 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.284 2002/09/17 19:45:11 matthew Exp $
+# $Id: lonnet.pm,v 1.285 2002/09/17 21:19:19 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -358,12 +358,13 @@
        my $loadfile=Apache::File->new('/proc/loadavg');
        $loadavg=<$loadfile>;
        $loadavg =~ s/\s.*//g;
+       $loadavg = 100*$loadavg/$perlvar{'lonLoadLim'};
     } else {
        $loadavg=&reply('load',$checkserver);
     }
-    my $overload=$loadavg-$perlvar{'lonLoadLim'};
+    my $overload=$loadavg-100;
     if ($overload>0) {
-	$r->err_headers_out->{'Retry-After'}=$overload*30;
+	$r->err_headers_out->{'Retry-After'}=$overload;
         $r->log_error('Overload of '.$overload.' on '.$checkserver);
         return 413;
     }