Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ Java VM options used for overriding default Java VM options specified in PuppetD

Example: to set `-Xmx512m -Xms256m` options use `{ '-Xmx' => '512m', '-Xms' => '256m' }`

####`max_threads`

Jetty option to explicetly set max-thread. The default is undef, so the jetty default is used (might be `120`).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not worth providing an assumption here (ie. 120) as its misleading from the start and the default may change anyway. I'd just say it falls back to the PuppetDB default.



### puppetdb:server

The `puppetdb::server` class manages the puppetdb server independently of the underlying database that it depends on. It will manage the puppetdb package, service, config files, etc., but will still allow you to manage the database (e.g. postgresql) however you see fit.
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
$puppetdb_service_status = $puppetdb::params::puppetdb_service_status,
$open_postgres_port = $puppetdb::params::open_postgres_port,
$confdir = $puppetdb::params::confdir,
$java_args = {}
$java_args = {},
$max_threads = $puppetdb::params::max_threads
) inherits puppetdb::params {

# Apply necessary suffix if zero is specified.
Expand Down Expand Up @@ -95,6 +96,7 @@
puppetdb_service_status => $puppetdb_service_status,
confdir => $confdir,
java_args => $java_args,
max_threads => $max_threads,
}

if ($database == 'postgres') {
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
$conn_keep_alive = '45'
$conn_lifetime = '0'

$max_threads = undef

case $::osfamily {
'RedHat': {
$firewall_supported = true
Expand Down
4 changes: 3 additions & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
$puppetdb_service_status = $puppetdb::params::puppetdb_service_status,
$confdir = $puppetdb::params::confdir,
$manage_firewall = true,
$java_args = {}
$java_args = {},
$max_threads = $puppetdb::params::max_threads
) inherits puppetdb::params {

# Apply necessary suffix if zero is specified.
Expand Down Expand Up @@ -108,6 +109,7 @@
ssl_listen_port => $ssl_listen_port,
disable_ssl => $disable_ssl,
confdir => $confdir,
max_threads => $max_threads,
notify => Service[$puppetdb_service],
}

Expand Down
13 changes: 13 additions & 0 deletions manifests/server/jetty_ini.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
$ssl_listen_port = $puppetdb::params::ssl_listen_port,
$disable_ssl = $puppetdb::params::disable_ssl,
$confdir = $puppetdb::params::confdir,
$max_threads = $puppetdb::params::max_threads,
) inherits puppetdb::params {

#Set the defaults
Expand Down Expand Up @@ -44,4 +45,16 @@
setting => 'ssl-port',
value => $ssl_listen_port,
}

if ($max_threads) {
ini_setting {'puppetdb_max_threads':
setting => 'max-threads',
value => $max_threads,
}
} else {
ini_setting {'puppetdb_max_threads':
ensure => absent,
setting => 'max-threads',
}
}
}
16 changes: 16 additions & 0 deletions spec/unit/classes/server/jetty_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,21 @@
'setting' => 'ssl-port'
)}
end

describe 'when setting max_threads' do
let(:params) do
{
'max_threads' => 150
}
end
it { should contain_ini_setting('puppetdb_max_threads').
with(
'ensure' => 'present',
'path' => '/etc/puppetdb/conf.d/jetty.ini',
'section' => 'jetty',
'setting' => 'max-threads',
'value' => '150'
)}
end
end
end