File: Resource.pod

package info (click to toggle)
libapache2-mod-perl2 2.0.13-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 12,016 kB
  • sloc: perl: 97,771; ansic: 14,493; makefile: 51; sh: 18
file content (83 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
=head1 NAME

Apache2::Resource - Limit resources used by httpd children



=head1 Synopsis

  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




=head1 Description

C<Apache2::Resource> uses the C<BSD::Resource> module, which uses the C
function C<setrlimit> to set limits on system resources such as memory
and cpu usage.

Any C<RLIMIT> operation available to limit on your system can be set
by defining that operation as an environment variable with a C<PERL_>
prefix.  See your system C<setrlimit> manpage for available resources
which can be limited.

The following limit values are in megabytes: C<DATA>, C<RSS>,
C<STACK>, C<FSIZE>, C<CORE>, C<MEMLOCK>; all others are treated as
their natural unit.

If the value of the variable is of the form C<S:H>, C<S> is treated as
the soft limit, and C<H> is the hard limit.  If it is just a single
number, it is used for both soft and hard limits.




=head1 Defaults

To set reasonable defaults for all RLIMITs, add this to your httpd.conf:

  PerlSetEnv PERL_RLIMIT_DEFAULTS On
  PerlModule Apache2::Resource



=head1 See Also

BSD::Resource(3), setrlimit(2)



=head1 Copyright

mod_perl 2.0 and its core modules are copyrighted under
The Apache Software License, Version 2.0.



=head1 Author

Doug MacEachern





=cut