Commit 9831cb26 authored by Dietmar Maurer's avatar Dietmar Maurer

add some comments about KeepAlive usage.

Seems KeepAlive spawns too many processes, so we cant use it.
parent 3fcc9c13
...@@ -21,6 +21,8 @@ use PVE::RPCEnvironment; ...@@ -21,6 +21,8 @@ use PVE::RPCEnvironment;
use Data::Dumper; # fixme: remove use Data::Dumper; # fixme: remove
# my $MaxRequestsPerChild = 200;
my $cookie_name = 'PVEAuthCookie'; my $cookie_name = 'PVEAuthCookie';
my $baseuri = "/api2"; my $baseuri = "/api2";
...@@ -465,11 +467,17 @@ my $known_methods = { ...@@ -465,11 +467,17 @@ my $known_methods = {
DELETE => 1, DELETE => 1,
}; };
my $request_count = 0;
sub handler { sub handler {
my($r) = @_; my($r) = @_;
debug_msg("perl handler called"); 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 $method = $r->method;
my $clientip = $r->connection->remote_ip(); my $clientip = $r->connection->remote_ip();
......
...@@ -44,6 +44,7 @@ sub childinit { ...@@ -44,6 +44,7 @@ sub childinit {
} }
sub childexit { sub childexit {
# BUG: seems this is not called if we do $r->child_terminate()
syslog ('info', "Finish child $$"); syslog ('info', "Finish child $$");
} }
......
...@@ -12,12 +12,16 @@ ServerTokens Prod ...@@ -12,12 +12,16 @@ ServerTokens Prod
ServerAdmin root ServerAdmin root
AddDefaultCharset On AddDefaultCharset On
# Hint: Ajax use KeepAlive, which in effect disables MaxRequestsPerChild, # Hint1: Ajax use KeepAlive. We wnat that to get better performance.
# so we need to disable KeepAlive to prevent exhaustive memory usage, or # Hint2: We need to limit the number of request to avoid exhaustive
# at least make sure that periodic updaters interval > KeepAliveTimeout # memory usage (we still have small memory leaks).
# or maybe we should set "MaxKeepAliveRequests 20" # 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> <IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/json AddOutputFilterByType DEFLATE application/json
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment