Skip to content
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

Auto pgtune #2796

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Auto pgtune #2796

wants to merge 2 commits into from

Conversation

edenkoveshi
Copy link

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?

Type of Changes:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

What is the current behavior? (link to any open issues here)

What is the new behavior (if this is a feature change)?
I think this is a really nice one. The idea is to automatically tune postgresql parameters according to https://pgtune.leopard.in.ua/#/ which I've found very useful over the years.
This is quite simple as Patroni dynamic configuration is already implemented.

The PostgresCluster type now has a new field: AutoPGTune, which has two fields: AppType and HDType, all optional.
If AutoPGTune is set, postgresql parameters are tweaked using the memory and cpu requests, and AppType and HDType if defined. None of them are mandatory, related parameters will simply not be tweaked, and AppType is assumed mixed if no value is given.
Obviously this is optional and not mandatory, not set by default.
AutoPGTune uses Patroni DynamicConfiguration, so enabling this essentialy enables Patroni. I've thought about putting the AutoPGTune field under Patroni but it seems confusing as they're not directly related. I'll leave it for you to decide though.
Enabling/disabling AutoPGTune does not cause a restart.
If both AutoPGTune and Patroni.DynamicConfiguration are set, Patroni.DynamicConfiguration overrides AutoPGTune, e.g.
autoPgTune: hdType: ssd patroni: dynamicConfiugration: random_page_cost = 10 will set random_page_cost to 10 even though it should be 1.1 according to pgtune. Other parameters will be set though as they're not overriden.

Other information:

@edenkoveshi
Copy link
Author

any news on that?

Copy link

@adamLutPhi adamLutPhi left a comment

Choose a reason for hiding this comment

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

Changes been reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants