Skip to content

Commit 3eec18d

Browse files
Merge pull request #113 from MartyEwings/sup-3769
(SUP-3769) Update Readme for new release
2 parents c0148df + 61df45e commit 3eec18d

File tree

2 files changed

+37
-90
lines changed

2 files changed

+37
-90
lines changed

README.md

+36-89
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,50 @@ Table of Contents
66
- [What does this module provide?](#what-does-this-module-provide)
77
- [Usage](#usage)
88
- [Items you may want to configure](#items-you-may-want-to-configure)
9-
- [Disable Maintenance](#disable-maintenance)
10-
- [General PostgreSQL Recommendations](#general-postgresql-recommendations)
11-
- [Tuning](#tuning)
12-
- [Maintenance](#maintenance)
13-
- [PostgreSQL Settings](#postgresql-settings)
14-
- [maintenance_work_mem](#maintenance_work_mem)
15-
- [work_mem](#work_mem)
16-
- [autovacuum_work_mem](#autovacuum_work_mem)
17-
- [autovacuum_max_workers](#autovacuum_max_workers)
18-
- [checkpoint_segments and checkpoint_completion_target](#checkpoint_segments-and-checkpoint_completion_target)
19-
- [How to Report an issue or contribute to the module](#how-to-report-an-issue-or-contribute-to-the-module)
9+
- [Maintenance](#maintenance)
10+
- [Disable Maintenance](#disable-maintenance)
11+
- [Deprecated functionality](#deprecated-functionality)
12+
- [Backups](#backups)
13+
- [PE PostgreSQL Tuning](#pe-postgresql-tuning)
2014
- [Supporting Content](#supporting-content)
2115
- [Articles](#articles)
2216
- [Videos](#videos)
17+
- [How to Report an issue or contribute to the module](#how-to-report-an-issue-or-contribute-to-the-module)
2318

2419
# Overview
2520

26-
This module provides tuning, and maintenance for PE PostgreSQL.
27-
2821
## What does this module provide?
2922

30-
This module provides the following functionaility
31-
32-
1. Customized settings for PE PostgreSQL
33-
1. Maintenance to keep the `pe-puppetdb` database lean and fast
23+
This module provides maintenance tasks to keep the `pe-puppetdb` database lean and fast
3424

3525
## Usage
3626

37-
In order to use this module, classify the node running PE PostgreSQL with the `pe_databases` class.
38-
The Primary Server and Replica run PE PostgreSQL in most instances, but there may be one or more servers with this role in an XL deployment
39-
40-
To classify via the PE Console, create a new node group called "PE Database Maintenance".
41-
Then pin the node(s) running pe-postgresql to that node group.
42-
It is not recommended to classify using a pre-existing node group in the PE Console.
43-
44-
## Items you may want to configure
45-
46-
47-
> WARNING: The backup functionality in this module has been removed.
48-
Please refer to the [PE Backup and Restore documentation](https://puppet.com/docs/pe/latest/backing_up_and_restoring_pe.html) for details on how to backup.
49-
You should ensure the parameter `pe_databases::manage_database_backups` and any parameters from the `pe_databases::backup` class are removed from classification or hiera.
50-
You should also clean up associated crontab entries.
51-
52-
### Disable Maintenance
27+
This module is bundled with all currently support versions of Puppet Enterprise, and enabled by default. When with Puppet Enterprise, see the following documentation for instructions on how to enable or disable.
5328

54-
The maintenance systemd timers will perform a `pg_repack` on various `pe-puppetdb` tables to keep them lean and fast.
55-
pg_repack is a non blocking operation and should have no impact on the operations of Puppet Enterprise, however, if for some reason you experience issues you can disable the maintenance systemd timers.
56-
You can do so by setting `pe_databases::disable_maintenance: true` in your hieradata.
29+
https://puppet.com/docs/pe/latest/pe_database_maintenance.html#enable_pe_database_module
5730

5831

59-
# General PostgreSQL Recommendations
60-
61-
## Tuning
62-
63-
Under normal operating conditions, there is very little tuning needed for PE PostgreSQL.
32+
## Items you may want to configure
6433

65-
If you are using a Monolithic installation of Puppet Enterprise then the default settings are well-tuned.
66-
If you are using a dedicated node for PE PostgreSQL, then some of the settings can be tuned upwards, but likely with little difference in performance.
6734

68-
This module attempts to provide default settings that accommodate both a Monolithic install and a dedicated PE PostgreSQL instance.
69-
Those defaults change based on the `$all_in_one_pe` parameter.
35+
### Maintenance
7036

71-
## Maintenance
37+
This module provides systemd timers to pg_repack tables in the `pe-puppetdb` database. These times are configurable using the corresponding parameters, but default to:
7238

73-
This module provides systemd timers to pg_repack tables in the `pe-puppetdb` database:
7439
- facts tables are pg_repack'd Tuesdays and Saturdays at 4:30AM
7540
- catalogs tables are pg_repack'd Sundays and Thursdays at 4:30AM
7641
- reports table is pg_repack'd on the 10th of the month at 05:30AM on systems with PE 2019.7.0 or less
7742
- resource_events table is pg_repack'd on the 15th of the month at 05:30AM on systems with PE 2019.3.0 or less
7843
- other tables are pg_repack'd on the 20th of the month at 5:30AM
7944

80-
> Note: You may be able to improve the performance (reduce time to completion) of maintenance tasks by increasing the [maintenance_work_mem](#maintenance_work_mem) setting.
45+
Classify the following parameters to change the values:
46+
```
47+
$facts_tables_repack_timer = 'Tue,Sat *-*-* 04:30:00',
48+
$catalogs_tables_repack_timer = 'Sun,Thu *-*-* 04:30:00',
49+
$other_tables_repack_timer = '*-*-20 05:30:00',
50+
$reports_tables_repack_timer = '*-*-10 05:30:00',
51+
$resource_events_tables_repack_timer = '*-*-15 05:30:00',
52+
```
8153

8254

8355
Please note that when using `pg_repack` as part of the pe_databases module, unclean exits can leave behind the schema when otherwise it should have been cleaned up. This can result in the messages similar to the following:
@@ -91,56 +63,28 @@ DETAIL: The trigger was probably installed during a previous attempt to run pg_r
9163
The module now contains a task `reset_pgrepack_schema` to mitigate this issue. This needs to be run against your Primary or PE-postgreSQL server to resolve this and it will drop and recreate the extension, removing the temporary objects.
9264

9365

94-
## PostgreSQL Settings
66+
#### Disable Maintenance
9567

96-
### [maintenance_work_mem](https://www.postgresql.org/docs/11/runtime-config-resource.html)
97-
98-
You can improve the speed of vacuuming, reindexing, and backups by increasing this setting.
99-
Consider a table that is 1GB.
100-
If `maintenance_work_mem` is `256MB`, then to perform operations on the table a quarter of it will be read into memory, operated on, then written out to disk, and then that will repeat three more times.
101-
If `maintenance_work_mem` is `1GB` then the entire table can be read into memory, operated on, then written out to disk.
102-
103-
Note: that each autovacuum worker can use up to this much memory, if you do not set [autovacuum_work_mem](https://www.postgresql.org/docs/11/runtime-config-resource.html) as well.
104-
105-
### [work_mem](https://www.postgresql.org/docs/11/runtime-config-resource.html)
106-
107-
Puppet Enterprise ships with a default `work_mem` of `4MB`.
108-
For most installations, this is all that is needed, however, at a larger scale you may need to increase to `8MB` or `16MB`.
109-
One way to know if you need more `work_mem` is to change the `log_temp_files` setting to 0 which will log all temporary files created by PostgreSQL.
110-
When you see a lot of temporary files being logged over the `work_mem` threshold then it’s time to consider increasing `work_mem`, however, you should first run a `REINDEX` and `VACUUM ANALYZE` to see if that reduces the number of temporary files being logged.
111-
112-
Another way to determine the need for an increase in `work_mem` is to get the query plan from a slow running query (accomplished by adding `EXPLAIN ANALYZE` to the beginning of the query).
113-
Query plans that have something like `Sort Method: external merge Disk` in them indicate a possible need for for more `work_mem`.
114-
115-
This is discussed on the [Tuning Your PostgreSQL Server Wiki](https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server#work_mem)
116-
117-
### [autovacuum_work_mem](https://www.postgresql.org/docs/11/runtime-config-resource.html)
118-
119-
This setting is essentially `maintenance_work_mem` but for autovacuum processes only.
120-
Usually you will set `maintenance_work_mem` higher and this lower, since `autovacuum_work_mem` is used by `autovacuum_max_workers` number of autovacuum processes.
121-
122-
### [autovacuum_max_workers](https://www.postgresql.org/docs/11/runtime-config-autovacuum.html)
68+
The maintenance systemd timers will perform a `pg_repack` on various `pe-puppetdb` tables to keep them lean and fast.
69+
pg_repack is a non blocking operation and should have no impact on the operations of Puppet Enterprise, however, if for some reason you experience issues you can disable the maintenance systemd timers.
70+
You can do so by setting `pe_databases::disable_maintenance: true` in your hieradata.
12371

124-
The larger your database the more autovacuum workers you may need.
125-
The default of `3` is reasonable for most small or medium installations of Puppet Enterprise.
126-
When you’re tracking the size of your database tables and indexes and you notice some of them seem to keep getting larger then you might need more autovacuum workers.
12772

128-
If you’ve installed PE PostgreSQL on its own node, then we recommend `CPU / 2` as a default for this setting (with a maximum of 8).
129-
For a Monolithic installation, increasing this setting means you likely need to compensate by reducing other settings that may cause your CPU to be over-subscribed during a peak.
130-
Those settings would be PuppetDB Command Processing Threads and Puppet Server JRuby Instances.
13173

132-
### [checkpoint_segments and checkpoint_completion_target](https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server#checkpoint_segments_checkpoint_completion_target)
13374

134-
We suggest a middle ground of `128` for `checkpoint_segments` and `.9` for `checkpoint_completion_target`.
135-
As mentioned in the PostgreSQL Wiki, the larger value you use for `checkpoint_segments` affords you better performance but you sacrifice in potential recovery time.
75+
## Deprecated functionality
13676

137-
If you see messages like “LOG: checkpoints are occurring too frequently (xx seconds apart)” then you definitely want to increase your `checkpoint_segments`.
13877

139-
## How to Report an issue or contribute to the module
78+
### Backups
79+
> WARNING: The backup functionality in this module has been removed.
80+
Please refer to the [PE Backup and Restore documentation](https://puppet.com/docs/pe/latest/backing_up_and_restoring_pe.html) for details on how to backup.
81+
You should ensure the parameter `pe_databases::manage_database_backups` and any parameters from the `pe_databases::backup` class are removed from classification or hiera.
82+
You should also clean up associated crontab entries.
14083

141-
If you are a PE user and need support using this module or are encountering issues, our Support team would be happy to help you resolve your issue and help reproduce any bugs. Just raise a ticket on the [support portal](https://support.puppet.com/hc/en-us/requests/new).
142-
If you have a reproducible bug or are a community user you can raise it directly on the Github issues page of the module [puppetlabs/puppetlabs-pe_databases](https://github.com/puppetlabs/puppetlabs-pe_databases/issues). We also welcome PR contributions to improve the module. Please see further details about contributing [here](https://puppet.com/docs/puppet/7.5/contributing.html#contributing_changes_to_module_repositories)
84+
### PE PostgreSQL Tuning
14385

86+
Recent versions of PE PostgreSQL included in all supported versions of Puppet Enterprise have superseded or improved upon the parameters previously tuned by this module, as such they are no longer required.
87+
Any classifications of the parameters relating to this functionality should be removed, however if set will harmlessly omit a warning of this deprecation.
14488

14589
---
14690

@@ -160,7 +104,10 @@ This Module has the following specific Article(s) available:
160104

161105
The [Support Video Playlist](https://youtube.com/playlist?list=PLV86BgbREluWKzzvVulR74HZzMl6SCh3S) is a resource of content generated by the support team
162106

107+
## How to Report an issue or contribute to the module
163108

109+
If you are a PE user and need support using this module or are encountering issues, our Support team would be happy to help you resolve your issue and help reproduce any bugs. Just raise a ticket on the [support portal](https://support.puppet.com/hc/en-us/requests/new).
110+
If you have a reproducible bug or are a community user you can raise it directly on the Github issues page of the module [puppetlabs/puppetlabs-pe_databases](https://github.com/puppetlabs/puppetlabs-pe_databases/issues). We also welcome PR contributions to improve the module. Please see further details about contributing [here](https://puppet.com/docs/puppet/7.5/contributing.html#contributing_changes_to_module_repositories)
164111

165112

166113
---

metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "puppetlabs-pe_databases",
33
"version": "2.3.0",
44
"author": "puppetlabs",
5-
"summary": "A Puppet Module for Backing Up / Maintaining / Tuning Your Puppet Enterprise Databases",
5+
"summary": "A Puppet Module for Maintaining Your Puppet Enterprise Databases",
66
"license": "Apache-2.0",
77
"source": "https://github.com/puppetlabs/puppetlabs-pe_databases",
88
"project_page": "https://github.com/puppetlabs/puppetlabs-pe_databases",

0 commit comments

Comments
 (0)