1docs::api::Apache2::ResUosuerrceC(o3n)tributed Perl Docudmoecnst:a:taipoin::Apache2::Resource(3)
2
3
4

NAME

6       Apache2::Resource - Limit resources used by httpd children
7

Synopsis

9         PerlModule Apache2::Resource
10         # set child memory limit in megabytes
11         # default is 64 Meg
12         PerlSetEnv PERL_RLIMIT_DATA 32:48
13
14         # linux does not honor RLIMIT_DATA
15         # RLIMIT_AS (address space) will work to limit the size of a process
16         PerlSetEnv PERL_RLIMIT_AS 32:48
17
18         # set child cpu limit in seconds
19         # default is 360 seconds
20         PerlSetEnv PERL_RLIMIT_CPU 120
21
22         PerlChildInitHandler Apache2::Resource
23

Description

25       "Apache2::Resource" uses the "BSD::Resource" module, which uses the C
26       function "setrlimit" to set limits on system resources such as memory
27       and cpu usage.
28
29       Any "RLIMIT" operation available to limit on your system can be set by
30       defining that operation as an environment variable with a "PERL_"
31       prefix.  See your system "setrlimit" manpage for available resources
32       which can be limited.
33
34       The following limit values are in megabytes: "DATA", "RSS", "STACK",
35       "FSIZE", "CORE", "MEMLOCK"; all others are treated as their natural
36       unit.
37
38       If the value of the variable is of the form "S:H", "S" is treated as
39       the soft limit, and "H" is the hard limit.  If it is just a single
40       number, it is used for both soft and hard limits.
41

Defaults

43       To set reasonable defaults for all RLIMITs, add this to your
44       httpd.conf:
45
46         PerlSetEnv PERL_RLIMIT_DEFAULTS On
47         PerlModule Apache2::Resource
48

See Also

50       BSD::Resource(3), setrlimit(2)
51
53       mod_perl 2.0 and its core modules are copyrighted under The Apache
54       Software License, Version 2.0.
55

Author

57       Doug MacEachern
58
59
60
61perl v5.36.0                      2022-07-21   docs::api::Apache2::Resource(3)
Impressum