File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 8
8
# The max number of simultaneous requests that will be served.
9
9
# This is the old name and is still supported. The new name is
10
10
# MaxRequestWorkers as of 2.3.13.
11
+ # If maxrequestworkers is set, this value is ignored.
11
12
#
12
13
# @param minsparethreads
13
14
# Minimum number of idle threads to handle request spikes.
40
41
# @param apache_version
41
42
# Used to verify that the Apache version you have requested is compatible with the module.
42
43
#
44
+ # @param maxrequestworkers
45
+ # Maximum number of connections that will be processed simultaneously
46
+ # if set, maxclients is ignored
47
+ #
43
48
# @see https://httpd.apache.org/docs/current/mod/worker.html for additional documentation.
44
49
#
45
50
class apache::mod::worker (
53
58
Integer $threadlimit = 64,
54
59
Integer $listenbacklog = 511,
55
60
Optional[String] $apache_version = undef ,
61
+ Optional[Integer] $maxrequestworkers = undef ,
56
62
) {
57
63
include apache
58
64
$_apache_version = pick($apache_version , $apache::apache_version )
Original file line number Diff line number Diff line change 113
113
{
114
114
serverlimit : 10 ,
115
115
startservers : 11 ,
116
- maxclients : 12 ,
116
+ maxrequestworkers : 12 ,
117
117
minsparethreads : 13 ,
118
118
maxsparethreads : 14 ,
119
119
threadsperchild : 15 ,
126
126
it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^<IfModule mpm_worker_module>$} ) }
127
127
it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +ServerLimit\s +10$} ) }
128
128
it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +StartServers\s +11$} ) }
129
- it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +MaxClients\s +12$} ) }
129
+ it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . without ( content : %r{^\s +MaxClients} ) }
130
+ it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +MaxRequestWorkers\s +12$} ) }
130
131
it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +MinSpareThreads\s +13$} ) }
131
132
it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +MaxSpareThreads\s +14$} ) }
132
133
it { is_expected . to contain_file ( '/etc/httpd/conf.modules.d/worker.conf' ) . with ( content : %r{^\s +ThreadsPerChild\s +15$} ) }
Original file line number Diff line number Diff line change 2
2
ServerLimit <%= @serverlimit %>
3
3
StartServers <%= @startservers %>
4
4
ThreadLimit <%= @threadlimit %>
5
- MaxClients <%= @maxclients %>
6
5
MinSpareThreads <%= @minsparethreads %>
7
6
MaxSpareThreads <%= @maxsparethreads %>
8
7
ThreadsPerChild <%= @threadsperchild %>
9
8
MaxRequestsPerChild <%= @maxrequestsperchild %>
10
9
ListenBacklog <%= @listenbacklog %>
10
+ <%- if @maxrequestworkers -%>
11
+ MaxRequestWorkers <%= @maxrequestworkers %>
12
+ <%- elsif @maxclients -%>
13
+ MaxClients <%= @maxclients %>
14
+ <%- end -%>
11
15
</ IfModule >
You can’t perform that action at this time.
0 commit comments