-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Postgres tuning revision #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bobjolliffe
wants to merge
3
commits into
master
Choose a base branch
from
postgres-tuning
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,12 +46,22 @@ Open http://dhis2-127-0-0-1.nip.io in your favourite browser. | |
|
|
||
| Custom configuration for Postgresql can be done by adding to the files in the `./config/postgresql/conf.d/` directory. If your configuration doesn't belong in either of the existing files, you can create a new file. However, it's advised not to make changes to the [postgresql.conf](config/postgresql/postgresql.conf) file. | ||
|
|
||
| Any changes to these files won't take effect until the container is restarted or the below command is executed: | ||
| Some postgresql configuration parameters can be applied by reloading the configuration. Others will only take effect when the database is restarted. The detailed description of each configuration option (on postgresql v16) is avalable [here](https://www.postgresql.org/docs/16/runtime-config.html). The documentation for each setting generally indicates whether the setting requires a restart in order to take effect. | ||
|
|
||
| A configuration reload can be triggered by executing the following SQL command: | ||
|
|
||
| ```sql | ||
| SELECT pg_reload_conf(); | ||
| ``` | ||
|
|
||
| If you need to restart the database server, it is safest to stop the application container first, restart the database, then start the application again. This will mean some minutes of downtime for your users so it is best to co-ordinate such operations with users or execute during quiet times of the day. A typical sequence might look like: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have multiple double spaces in this paragraph |
||
|
|
||
| ```bash | ||
| docker compose stop app | ||
| docker compose restart database | ||
| docker compose start app | ||
| ``` | ||
|
|
||
| ## Overlays | ||
|
|
||
| ### Traefik Dashboard | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| log_destination = 'stderr' | ||
| logging_collector = off # disable writing to files | ||
| log_statement = 'ddl' # or 'all' if you want full query logging | ||
| log_min_duration_statement = 500 # log queries slower than 500ms | ||
| log_statement = 'none' # or 'all' if you want full query logging | ||
| log_min_duration_statement = 300s # log queries slower than 5 minutes | ||
tonsV2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| log_timezone = 'UTC' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| checkpoint_completion_target = 0.8 | ||
| synchronous_commit = off | ||
| wal_writer_delay = 10000ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,11 @@ | ||
| # These settings are required to run DHIS2 | ||
| # Make local customisations under /etc/postgresql/conf.d | ||
| listen_addresses = '*' | ||
|
|
||
| # affects the performance of program indicators | ||
| jit = off | ||
|
|
||
| # required for flyway | ||
| max_locks_per_transaction = 128 | ||
|
|
||
| include_dir = '/etc/postgresql/conf.d' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have multiple double spaces in this paragraph