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;
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();
......
......@@ -44,6 +44,7 @@ sub childinit {
}
sub childexit {
# BUG: seems this is not called if we do $r->child_terminate()
syslog ('info', "Finish child $$");
}
......
......@@ -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"
KeepAlive Off
# 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
# But KeepAlive spawns too many processes - so we disable that for now
KeepAlive off
MaxKeepAliveRequests 200
<IfModule mod_deflate.c>
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