]> git.proxmox.com Git - pve-manager.git/commitdiff
add some comments about KeepAlive usage.
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Nov 2011 08:21:28 +0000 (09:21 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Nov 2011 08:21:28 +0000 (09:21 +0100)
Seems KeepAlive spawns too many processes, so we cant use it.

PVE/REST.pm
www/manager/startup.pl
www/templates/pve.conf

index e9ad2b71292377f8af22a717ccd906c0e8bff494..1d68594309107b9375774854149a7cdfe5ecf634 100644 (file)
@@ -21,6 +21,8 @@ use PVE::RPCEnvironment;
 
 use Data::Dumper; # fixme: remove
 
+# my $MaxRequestsPerChild = 200;
+
 my $cookie_name = 'PVEAuthCookie';
 
 my $baseuri = "/api2";
@@ -465,11 +467,17 @@ my $known_methods = {
     DELETE => 1,
 };
 
+my $request_count = 0;
+
 sub handler {
      my($r) = @_;
 
      debug_msg("perl handler called");
 
+     $request_count++;
+     # we do not use KeepAlive, so this is not necessary
+     # $r->child_terminate() if $request_count >= $MaxRequestsPerChild;
+
      my $method = $r->method;
      my $clientip = $r->connection->remote_ip();
 
index 23d7839861ab8f606e0a0e2dfe5eb80473e72d82..5d799897612f77816f0c676cca4f902ce2cb2c5f 100755 (executable)
@@ -44,6 +44,7 @@ sub childinit {
 }
 
 sub childexit {
+    # BUG: seems this is not called if we do $r->child_terminate()
     syslog ('info', "Finish child $$");
 }
 
index 090f2b98d85bf5cbfd323185867e2f34033b3a24..908bc72bc683dc0ae42f79561823af944eaaae40 100644 (file)
@@ -12,12 +12,16 @@ ServerTokens Prod
 ServerAdmin root
 AddDefaultCharset On
 
-# Hint: Ajax use KeepAlive, which in effect disables MaxRequestsPerChild,
-# so we need to disable KeepAlive to prevent exhaustive memory usage, or
-# at least make sure that periodic updaters interval > KeepAliveTimeout 
-# or maybe we should set "MaxKeepAliveRequests 20"
+# Hint1: Ajax use KeepAlive. We wnat that to get better performance.
+# Hint2: We need to limit the number of request to avoid exhaustive 
+# memory usage (we still have small memory leaks).
+# Apache KeepAlive in effect disables MaxRequestsPerChild,
+# (max request are  MaxRequestsPerChild*MaxKeepAliveRequests)
+# so we implemented and additional limit in REST.pm
 
-KeepAlive Off
+# But KeepAlive spawns too many processes - so we disable that for now
+KeepAlive off
+MaxKeepAliveRequests 200
 
 <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE application/json