.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "docs::api::Apache2::Resource 3pm" .TH docs::api::Apache2::Resource 3pm 2024-01-10 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Apache2::Resource \- Limit resources used by httpd children .SH Synopsis .IX Header "Synopsis" .Vb 4 \& PerlModule Apache2::Resource \& # set child memory limit in megabytes \& # default is 64 Meg \& PerlSetEnv PERL_RLIMIT_DATA 32:48 \& \& # linux does not honor RLIMIT_DATA \& # RLIMIT_AS (address space) will work to limit the size of a process \& PerlSetEnv PERL_RLIMIT_AS 32:48 \& \& # set child cpu limit in seconds \& # default is 360 seconds \& PerlSetEnv PERL_RLIMIT_CPU 120 \& \& PerlChildInitHandler Apache2::Resource .Ve .SH Description .IX Header "Description" \&\f(CW\*(C`Apache2::Resource\*(C'\fR uses the \f(CW\*(C`BSD::Resource\*(C'\fR module, which uses the C function \f(CW\*(C`setrlimit\*(C'\fR to set limits on system resources such as memory and cpu usage. .PP Any \f(CW\*(C`RLIMIT\*(C'\fR operation available to limit on your system can be set by defining that operation as an environment variable with a \f(CW\*(C`PERL_\*(C'\fR prefix. See your system \f(CW\*(C`setrlimit\*(C'\fR manpage for available resources which can be limited. .PP The following limit values are in megabytes: \f(CW\*(C`DATA\*(C'\fR, \f(CW\*(C`RSS\*(C'\fR, \&\f(CW\*(C`STACK\*(C'\fR, \f(CW\*(C`FSIZE\*(C'\fR, \f(CW\*(C`CORE\*(C'\fR, \f(CW\*(C`MEMLOCK\*(C'\fR; all others are treated as their natural unit. .PP If the value of the variable is of the form \f(CW\*(C`S:H\*(C'\fR, \f(CW\*(C`S\*(C'\fR is treated as the soft limit, and \f(CW\*(C`H\*(C'\fR is the hard limit. If it is just a single number, it is used for both soft and hard limits. .SH Defaults .IX Header "Defaults" To set reasonable defaults for all RLIMITs, add this to your httpd.conf: .PP .Vb 2 \& PerlSetEnv PERL_RLIMIT_DEFAULTS On \& PerlModule Apache2::Resource .Ve .SH "See Also" .IX Header "See Also" \&\fBBSD::Resource\fR\|(3), \fBsetrlimit\fR\|(2) .SH Copyright .IX Header "Copyright" mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. .SH Author .IX Header "Author" Doug MacEachern