[LON-CAPA-cvs] cvs: loncom /interface lonchatfetch.pm londocs.pm lonsearchcat.pm lonstatistics.pm lontrackstudent.pm /interface/spreadsheet lonspreadsheet.pm /lonnet/perl lonnet.pm

www www@source.lon-capa.org
Mon, 03 May 2010 16:41:57 -0000


www		Mon May  3 16:41:57 2010 EDT

  Modified files:              
    /loncom/interface	lonchatfetch.pm londocs.pm lonsearchcat.pm 
                     	lonstatistics.pm lontrackstudent.pm 
    /loncom/interface/spreadsheet	lonspreadsheet.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Overload was not a good idea. Let the operating system take care of this.
  
  
Index: loncom/interface/lonchatfetch.pm
diff -u loncom/interface/lonchatfetch.pm:1.36 loncom/interface/lonchatfetch.pm:1.37
--- loncom/interface/lonchatfetch.pm:1.36	Fri Oct 23 10:21:00 2009
+++ loncom/interface/lonchatfetch.pm	Mon May  3 16:41:51 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Chat Fetching
 #
-# $Id: lonchatfetch.pm,v 1.36 2009/10/23 10:21:00 bisitz Exp $
+# $Id: lonchatfetch.pm,v 1.37 2010/05/03 16:41:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -69,13 +69,6 @@
         return HTTP_NOT_ACCEPTABLE;
     }
 
-    my $loaderror=&Apache::lonnet::overloaderror($r);
-    if ($loaderror) { return $loaderror; }
-    $loaderror=
-       &Apache::lonnet::overloaderror($r,
-         $env{'course.'.$env{'request.course.id'}.'.home'});
-    if ($loaderror) { return $loaderror; }
-
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     return OK if $r->header_only;
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.426 loncom/interface/londocs.pm:1.427
--- loncom/interface/londocs.pm:1.426	Wed Apr 14 13:58:11 2010
+++ loncom/interface/londocs.pm	Mon May  3 16:41:51 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.426 2010/04/14 13:58:11 wenzelju Exp $
+# $Id: londocs.pm,v 1.427 2010/05/03 16:41:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2264,8 +2264,6 @@
 sub verifycontent {
     my ($r) = @_;
     my $crstype = &Apache::loncommon::course_type();
-   my $loaderror=&Apache::lonnet::overloaderror($r);
-   if ($loaderror) { return $loaderror; }
    $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents'));
    $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents'));
    $hashtied=0;
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.320 loncom/interface/lonsearchcat.pm:1.321
--- loncom/interface/lonsearchcat.pm:1.320	Sat Feb 13 01:12:16 2010
+++ loncom/interface/lonsearchcat.pm	Mon May  3 16:41:51 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.320 2010/02/13 01:12:16 raeburn Exp $
+# $Id: lonsearchcat.pm,v 1.321 2010/05/03 16:41:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -118,8 +118,6 @@
                       # This is set and used in &handler() and is also used in 
                       # &output_results().
 
-    my $loaderror=&Apache::lonnet::overloaderror($r);
-    if ($loaderror) { return $loaderror; }
     #
     my $closebutton;  # button that closes the search window 
                       # This button is different for the RAT compared to
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.151 loncom/interface/lonstatistics.pm:1.152
--- loncom/interface/lonstatistics.pm:1.151	Wed Apr 28 14:55:58 2010
+++ loncom/interface/lonstatistics.pm	Mon May  3 16:41:51 2010
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.151 2010/04/28 14:55:58 wenzelju Exp $
+# $Id: lonstatistics.pm,v 1.152 2010/05/03 16:41:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -792,14 +792,6 @@
     my $r=shift;
     my $c = $r->connection();
     #
-    # Check for overloading
-    my $loaderror=&Apache::lonnet::overloaderror($r);
-    if ($loaderror) { return $loaderror; }
-    $loaderror=
-       &Apache::lonnet::overloaderror($r,
-         $env{'course.'.$env{'request.course.id'}.'.home'});
-    if ($loaderror) { return $loaderror; }
-    #
     # Check for access
     if (! &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
         $env{'user.error.msg'}=
Index: loncom/interface/lontrackstudent.pm
diff -u loncom/interface/lontrackstudent.pm:1.30 loncom/interface/lontrackstudent.pm:1.31
--- loncom/interface/lontrackstudent.pm:1.30	Fri Aug 28 22:47:07 2009
+++ loncom/interface/lontrackstudent.pm	Mon May  3 16:41:51 2010
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lontrackstudent.pm,v 1.30 2009/08/28 22:47:07 raeburn Exp $
+# $Id: lontrackstudent.pm,v 1.31 2010/05/03 16:41:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -525,15 +525,6 @@
     my $r=shift;
     my $c = $r->connection();
     #
-    # Check for overloading here and on the course home server
-    my $loaderror=&Apache::lonnet::overloaderror($r);
-    if ($loaderror) { return $loaderror; }
-    $loaderror=
-        &Apache::lonnet::overloaderror
-        ($r,
-         $env{'course.'.$env{'request.course.id'}.'.home'});
-    if ($loaderror) { return $loaderror; }
-    #
     # Check for access
     if (! &Apache::lonnet::allowed('vsa',$env{'request.course.id'})) {
         $env{'user.error.msg'}=
Index: loncom/interface/spreadsheet/lonspreadsheet.pm
diff -u loncom/interface/spreadsheet/lonspreadsheet.pm:1.55 loncom/interface/spreadsheet/lonspreadsheet.pm:1.56
--- loncom/interface/spreadsheet/lonspreadsheet.pm:1.55	Wed Jul  8 17:55:10 2009
+++ loncom/interface/spreadsheet/lonspreadsheet.pm	Mon May  3 16:41:54 2010
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.55 2009/07/08 17:55:10 bisitz Exp $
+# $Id: lonspreadsheet.pm,v 1.56 2010/05/03 16:41:54 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -200,16 +200,6 @@
 sub handler {
     my $r=shift;
     #
-    # Overload checking
-    #
-    # Check this server
-    my $loaderror=&Apache::lonnet::overloaderror($r);
-    if ($loaderror) { return $loaderror; }
-    # Check the course homeserver
-    $loaderror= &Apache::lonnet::overloaderror($r,
-                      $env{'course.'.$env{'request.course.id'}.'.home'});
-#    if ($loaderror) { return $loaderror; } 
-    #
     # HTML Header
     #
     if ($r->header_only) {
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1060 loncom/lonnet/perl/lonnet.pm:1.1061
--- loncom/lonnet/perl/lonnet.pm:1.1060	Fri Mar 26 00:47:25 2010
+++ loncom/lonnet/perl/lonnet.pm	Mon May  3 16:41:57 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1060 2010/03/26 00:47:25 raeburn Exp $
+# $Id: lonnet.pm,v 1.1061 2010/05/03 16:41:57 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -665,30 +665,6 @@
     return $userloadpercent;
 }
 
-# ------------------------------------------ Fight off request when overloaded
-
-sub overloaderror {
-    my ($r,$checkserver)=@_;
-    unless ($checkserver) { $checkserver=$perlvar{'lonHostID'}; }
-    my $loadavg;
-    if ($checkserver eq $perlvar{'lonHostID'}) {
-       open(my $loadfile,'/proc/loadavg');
-       $loadavg=<$loadfile>;
-       $loadavg =~ s/\s.*//g;
-       $loadavg = 100*$loadavg/$perlvar{'lonLoadLim'};
-       close($loadfile);
-    } else {
-       $loadavg=&reply('load',$checkserver);
-    }
-    my $overload=$loadavg-100;
-    if ($overload>0) {
-	$r->err_headers_out->{'Retry-After'}=$overload;
-        $r->log_error('Overload of '.$overload.' on '.$checkserver);
-        return 413;
-    }    
-    return '';
-}
-
 # ------------------------------ Find server with least workload from spare.tab
 
 sub spareserver {