httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Malo ...@perlig.de>
Subject Re: [users@httpd] Restricting cgi processor usage
Date Wed, 16 Apr 2003 13:36:58 GMT
* Richard Shaw wrote:

> Thanks, i've put that in place, but was wondering how to confirm that its working..

You may write a simple test cgi script, like

#!/usr/bin/perl

$SIG{XCPU} = sub {
    print "Content-type: text/plain\n\n";
    print "received XCPU, exiting.\n";
    exit 0;
}

# start infinite loop
1 while 1;

__END__

(be aware to kill the script if the limit doesn't work :)

With
RlimitCPU 1
the script should print after one (cpu-)second "received XPU ..." to the 
browser.

> Is there any way you know of to get Apache to report it's rlimits ?

Apache inherits the system settings. Specific settings may be grabbed from 
the server-info handler. (mod_info)

nd
-- 
sub the($){+shift} sub answer (){ord q
        [* It is always 42! *]       }
           print the answer
# André Malo # http://pub.perlig.de/ #

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message