|
15 | 15 | # @param other_tables_repack_timer [String] The Systemd timer for the pg_repack job affecting the 'other' tables
|
16 | 16 | # @param reports_tables_repack_timer [String] The Systemd timer for the pg_repack job affecting the 'reports' tables
|
17 | 17 | # @param resource_events_tables_repack_timer [String] The Systemd timer for the pg_repack job affecting the 'resource_events' tables
|
| 18 | +# @param maintenance_work_mem [String] Increase to improve speed of speed of vacuuming and reindexing (Example "1GB") |
| 19 | +# @param work_mem [String] Allows PostgreSQL to do larger in-memory sorts (Default: "4MB") |
| 20 | +# @param autovacuum_work_mem [String] Similar to but for maintenance_work_mem autovacuum processes only (Example "256MB") |
| 21 | +# @param autovacuum_max_workers [Integer] Maximum number of autovacuum processes to run concurrently (Default: 3) |
| 22 | +# |
18 | 23 | class pe_databases (
|
19 |
| - Boolean $manage_database_maintenance = true, |
20 |
| - Boolean $disable_maintenance = false, |
21 |
| - Boolean $manage_postgresql_settings = true, |
22 |
| - Boolean $manage_table_settings = false, |
23 |
| - String[1] $install_dir = '/opt/puppetlabs/pe_databases', |
24 |
| - String[1] $scripts_dir = "${install_dir}/scripts", |
| 24 | +# lint:ignore:140chars lint:ignore:optional_default |
25 | 25 | String[1] $facts_tables_repack_timer = 'Tue,Sat *-*-* 04:30:00',
|
26 | 26 | String[1] $catalogs_tables_repack_timer = 'Sun,Thu *-*-* 04:30:00',
|
27 | 27 | String[1] $other_tables_repack_timer = '*-*-20 05:30:00',
|
28 | 28 | String[1] $reports_tables_repack_timer = '*-*-10 05:30:00',
|
29 | 29 | String[1] $resource_events_tables_repack_timer = '*-*-15 05:30:00',
|
| 30 | + Boolean $all_in_one_pe_install = true, |
| 31 | + Hash $arbitrary_postgresql_conf_settings = {}, |
| 32 | + Float[0,1] $autovacuum_vacuum_scale_factor = 0.08, |
| 33 | + Float[0,1] $autovacuum_analyze_scale_factor = 0.04, |
| 34 | + Integer $autovacuum_max_workers = max(3, min(8, $facts['processors']['count'] / 3)), |
| 35 | + String $autovacuum_work_mem = $all_in_one_pe_install ? { |
| 36 | + false => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 3 / $autovacuum_max_workers}MB", |
| 37 | + true => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 8 / $autovacuum_max_workers}MB", |
| 38 | + }, |
| 39 | + Optional[Float[0,1]] $catalogs_autovacuum_vacuum_scale_factor = 0.75, |
| 40 | + Optional[Float[0,1]] $certnames_autovacuum_vacuum_scale_factor = 0.75, |
| 41 | + Float[0,1] $checkpoint_completion_target = 0.9, |
| 42 | + Integer $checkpoint_segments = 128, |
| 43 | + Boolean $disable_maintenance = false, |
| 44 | + Optional[Float[0,1]] $factsets_autovacuum_vacuum_scale_factor = 0.80, |
| 45 | + String $install_dir = '/opt/puppetlabs/pe_databases', |
| 46 | + Integer $log_autovacuum_min_duration = -1, |
| 47 | + Integer $log_temp_files = -1, |
| 48 | + String $maintenance_work_mem = $all_in_one_pe_install ? { |
| 49 | + false => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 3}MB", |
| 50 | + true => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 8}MB", |
| 51 | + }, |
| 52 | + Boolean $manage_database_maintenance = true, |
| 53 | + Boolean $manage_postgresql_service = true, |
| 54 | + Boolean $manage_postgresql_settings = true, |
| 55 | + Boolean $manage_reports_autovacuum_cost_delay = true, |
| 56 | + Boolean $manage_table_settings = false, |
| 57 | + Integer $max_connections = 1000, |
| 58 | + String $scripts_dir = "${install_dir}/scripts", |
| 59 | + String $work_mem = '8MB', |
| 60 | + Optional[Float[0,1]] $reports_autovacuum_vacuum_scale_factor = 0.01, |
| 61 | + # lint:endignore |
30 | 62 | ) {
|
31 | 63 | $psql_version = $facts['pe_postgresql_info']['installed_server_version'] ? {
|
32 | 64 | undef => undef,
|
|
0 commit comments