use Data::Dumper; # fixme: remove
+# my $MaxRequestsPerChild = 200;
+
my $cookie_name = 'PVEAuthCookie';
my $baseuri = "/api2";
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();
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