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

Update supautils.conf.j2 | allow users to log temp files #1280

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

TheOtherBrian1
Copy link
Contributor

@TheOtherBrian1 TheOtherBrian1 commented Oct 17, 2024

What kind of change does this PR introduce?

Allow users to log temp files

What is the current behavior?

Users cannot reconfigure the log_temp_files variable

What is the new behavior?

Users can now log temp files, which is necessary for reconfiguring work_mem

Additional context

I was at pgconf_nyc a few weeks ago and I spoke to Christophe Pettus, a Postgres Expert at PGX. He told me that its best practice to log all temp_file creation as it is one of the best ways to know when to modify work_mem. He made a blog post that expounds on his reasoning.

It just so happens that I came across a ticket creating a bunch of GB size temp files and it caused their disk to expand.

Because we now charge for disk provisioned vs. disk used, the "usage" warnings are making this problem much more noticeable to users. Because they're complaining more, there's a need to give them tools to self-manage

@TheOtherBrian1 TheOtherBrian1 requested a review from a team as a code owner October 17, 2024 16:36
@@ -7,6 +7,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da
supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'
supautils.privileged_extensions_superuser = 'supabase_admin'
supautils.privileged_role = 'postgres'
supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing'
supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, log_temp_files, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing'
Copy link
Contributor

Choose a reason for hiding this comment

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

We really need to push these to be handled via https://supabase.com/docs/guides/platform/custom-postgres-config , rather than supautils

If you update them using supautils, they won't get replicated to replicas (and in the future, failover primaries).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of our settings work_mem and max_parallel_workers can be set through both the CLI and just generic SQL. For the time being, this is a fast way to make configs accessible.

" they won't get replicated to replicas (and in the future, failover primaries)."

Is this true only for supautils enabled settings or for any change outside of the CLI? Either or, a note should be added to the customizing postgres docs

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