Update conf file with ALTER SYSTEM SET on Postgres

328 views
Skip to first unread message

tomer a

unread,
Nov 11, 2021, 3:12:05 AM11/11/21
to Google Cloud SQL discuss
I want to update the conf file of my server because I need to have more workers for my queries but setting max_logical_replication_workers = 8.
But I get error that its not allowed when running this:

ALTER SYSTEM SET max_logical_replication_workers = 8;

ERROR: must be superuser to execute ALTER SYSTEM command

I saw from the docs that I canot have superuser permissions. 

Is there a way to update this fields? its seems very weird to me that I canot scale my server.
I tested my server by getting 16vCPU to work but each query is capped to 4 workers so getting bigger machines does nothing.

Sergi Ferre Albiol

unread,
Nov 12, 2021, 6:47:42 AM11/12/21
to Google Cloud SQL discuss

Hello,

As Cloud SQL is a fully managed service the Superuser is not supported in Cloud SQL [1].

Searching all the flags [2] that are available in order to configure a Cloud SQL instance, it seems that max_logical_replication_workers is not available. I would suggest you to open a feature request [3] asking to implement this as a database flag.

Also another suggestion would be to host your PostgreSQL to Compute Engine that will give you more flexibility [4].

-----

[1] https://cloud.google.com/sql/docs/postgres/features#unsupported_features

[2] https://cloud.google.com/sql/docs/postgres/flags#list-flags-postgres

[3] https://issuetracker.google.com

[4] https://cloud.google.com/architecture/cloning-a-postgresql-database-on-compute-engine

Peter Kok

unread,
Nov 12, 2021, 8:11:54 AM11/12/21
to google-cloud...@googlegroups.com
Hello,

We are running the cloud SQL proxy in docker-compose as follows:

  gce-proxy:
    hostname: app-db
    container_name: gce-proxy
    image: gcr.io/cloudsql-docker/gce-proxy:${CLOUD_PROXY_VERSION}
    entrypoint: "/cloud_sql_proxy -instances=${CLOUD_INSTANCE}=tcp:0.0.0.0:5432 -credential_file=/cloudsql/${CLOUD_CREDENTIAL_FILE}"
    volumes:
      - ${CLOUD_CREDENTIAL_PATH}:/cloudsql
    ports:
      - ${CLOUD_PROXY_PORT}:5432
    restart: always


The variable ${CLOUD_CREDENTIAL_PATH} contains the absolute path to the directory with the json credential file 
The variable ${CLOUD_CREDENTIAL_FILE} contains the credential.json 

Hope this helps...
Peter

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/461bd9d3-d2fb-4ab4-abbe-d9c8a5edc4b6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages