perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgollu...@apache.org
Subject svn commit: r365800 - /perl/modperl/trunk/lib/Apache2/SizeLimit.pm
Date Wed, 04 Jan 2006 02:17:53 GMT
Author: pgollucci
Date: Tue Jan  3 18:17:49 2006
New Revision: 365800

URL: http://svn.apache.org/viewcvs?rev=365800&view=rev
Log:
minor changes
 o add unshared to the output if set
 o add display of value/(config value)


Modified:
    perl/modperl/trunk/lib/Apache2/SizeLimit.pm

Modified: perl/modperl/trunk/lib/Apache2/SizeLimit.pm
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/Apache2/SizeLimit.pm?rev=365800&r1=365799&r2=365800&view=diff
==============================================================================
--- perl/modperl/trunk/lib/Apache2/SizeLimit.pm (original)
+++ perl/modperl/trunk/lib/Apache2/SizeLimit.pm Tue Jan  3 18:17:49 2006
@@ -189,25 +189,29 @@
     $START_TIME ||= time;
 
     my ($size, $share) = $HOW_BIG_IS_IT->();
+    my $unshared = $size - $share;
 
-    if (($MAX_PROCESS_SIZE  && $size > $MAX_PROCESS_SIZE) ||
-        ($MIN_SHARE_SIZE    && $share < $MIN_SHARE_SIZE)  ||
-        ($MAX_UNSHARED_SIZE && ($size - $share) > $MAX_UNSHARED_SIZE)) {
+    my $kill_size     = $MAX_PROCESS_SIZE  && $size > $MAX_PROCESS_SIZE;
+    my $kill_share    = $MIN_SHARE_SIZE    && $share < $MIN_SHARE_SIZE;
+    my $kill_unshared = $MAX_UNSHARED_SIZE && $unshared > $MAX_UNSHARED_SIZE;
 
+    if ($kill_size || $kill_share || $kill_unshared) {
         # wake up! time to die.
         if (WIN32 || ( getppid > 1 )) {
             # this is a child httpd
             my $e   = time - $START_TIME;
-            my $msg = "httpd process too big, exiting at SIZE=$size KB ";
-            $msg .= " SHARE=$share KB " if $share;
+            my $msg = "httpd process too big, exiting at SIZE=$size/$MAX_PROCESS_SIZE KB
";
+            $msg .= " SHARE=$share/$MIN_SHARE_SIZE KB " if $share;
+            $msg .= " UNSHARED=$unshared/$MAX_UNSHARED_SIZE KB " if $unshared;
             $msg .= " REQUESTS=$REQUEST_COUNT LIFETIME=$e seconds";
             error_log($msg);
 
             $r->child_terminate();
         }
         else {    # this is the main httpd, whose parent is init?
-            my $msg = "main process too big, SIZE=$size KB ";
-            $msg .= " SHARE=$share KB" if $share;
+            my $msg = "main process too big, SIZE=$size/$MAX_PROCESS_SIZE KB ";
+            $msg .= " SHARE=$share/$MIN_SHARE_SIZE KB" if $share;
+            $msg .= " UNSHARED=$unshared/$MAX_UNSHARED_SIZE KB" if $unshared;
             error_log($msg);
         }
     }



Mime
View raw message