Skip to content

fix: increase database to GP_Standard_D4ds_v5 - #217

Merged
thenav56 merged 3 commits into
developfrom
fix/increase-db-GP_Standard_D4ds_v5
Sep 4, 2026
Merged

fix: increase database to GP_Standard_D4ds_v5#217
thenav56 merged 3 commits into
developfrom
fix/increase-db-GP_Standard_D4ds_v5

Conversation

@thenav56

@thenav56 thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member

Continue of #216

@thenav56 thenav56 changed the title fix: increase database to GP_Standard_D4ds_v5. - #216 fix: increase database to GP_Standard_D4ds_v5 Sep 4, 2026
@thenav56

thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Plan:

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.resources.azurerm_postgresql_flexible_server.montandon_eoapi will be updated in-place
  ~ resource "azurerm_postgresql_flexible_server" "montandon_eoapi" {
        id                            = "/subscriptions/39308fb0-9929-4b29-aafa-b3c78a8b0658/resourceGroups/ifrctgo002rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/montandon-eoapi-staging-psql-flexible-server"
        name                          = "montandon-eoapi-staging-psql-flexible-server"
      ~ sku_name                      = "GP_Standard_D2ds_v5" -> "GP_Standard_D4ds_v5"
        tags                          = {}
        # (16 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.resources.azurerm_postgresql_flexible_server_configuration.montandon_eoapi_postgres_config["shared_buffers"] will be created
  + resource "azurerm_postgresql_flexible_server_configuration" "montandon_eoapi_postgres_config" {
      + id        = (known after apply)
      + name      = "shared_buffers"
      + server_id = "/subscriptions/39308fb0-9929-4b29-aafa-b3c78a8b0658/resourceGroups/ifrctgo002rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/montandon-eoapi-staging-psql-flexible-server"
      + value     = "4194304"
    }

  # module.resources.azurerm_postgresql_flexible_server_configuration.montandon_eoapi_postgres_config["work_mem"] will be created
  + resource "azurerm_postgresql_flexible_server_configuration" "montandon_eoapi_postgres_config" {
      + id        = (known after apply)
      + name      = "work_mem"
      + server_id = "/subscriptions/39308fb0-9929-4b29-aafa-b3c78a8b0658/resourceGroups/ifrctgo002rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/montandon-eoapi-staging-psql-flexible-server"
      + value     = "65536"
    }

Plan: 2 to add, 1 to change, 0 to destroy.

Plan looks good, @pantierra @batpad can you also confirm? Then we can go ahead with the merge.

Note

For this we will need to push to master branch for the production changes.

@thenav56

thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Also, we might have an issue with shared_buffers value

Postgres stores shared_buffers internally in blocks, where a block is BLCKSZ = 8 kB in every standard build. Resulting size will be 32 GiB which is 2 times the instance memory when shared_buffers = "4194304" is used

Comment thread base-infrastructure/terraform/resources/database.tf Outdated
Co-authored-by: Felix <felix@developmentseed.org>
@thenav56

thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Plan is good.

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.resources.azurerm_postgresql_flexible_server.montandon_eoapi will be updated in-place
  ~ resource "azurerm_postgresql_flexible_server" "montandon_eoapi" {
        id                            = "/subscriptions/39308fb0-9929-4b29-aafa-b3c78a8b0658/resourceGroups/ifrctgo002rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/montandon-eoapi-staging-psql-flexible-server"
        name                          = "montandon-eoapi-staging-psql-flexible-server"
      ~ sku_name                      = "GP_Standard_D2ds_v5" -> "GP_Standard_D4ds_v5"
        tags                          = {}
        # (16 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.resources.azurerm_postgresql_flexible_server_configuration.montandon_eoapi_postgres_config["shared_buffers"] will be created
  + resource "azurerm_postgresql_flexible_server_configuration" "montandon_eoapi_postgres_config" {
      + id        = (known after apply)
      + name      = "shared_buffers"
      + server_id = "/subscriptions/39308fb0-9929-4b29-aafa-b3c78a8b0658/resourceGroups/ifrctgo002rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/montandon-eoapi-staging-psql-flexible-server"
      + value     = "524288"
    }

  # module.resources.azurerm_postgresql_flexible_server_configuration.montandon_eoapi_postgres_config["work_mem"] will be created
  + resource "azurerm_postgresql_flexible_server_configuration" "montandon_eoapi_postgres_config" {
      + id        = (known after apply)
      + name      = "work_mem"
      + server_id = "/subscriptions/39308fb0-9929-4b29-aafa-b3c78a8b0658/resourceGroups/ifrctgo002rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/montandon-eoapi-staging-psql-flexible-server"
      + value     = "65536"
    }

I will merge this in few minutes

@thenav56
thenav56 merged commit 35867c0 into develop Sep 4, 2026
3 checks passed
@thenav56
thenav56 deleted the fix/increase-db-GP_Standard_D4ds_v5 branch September 4, 2026 09:01
@thenav56

thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

@szabozoltan69 @pantierra @batpad This has been applied to the staging instance (~ 13 min). Can you check?

@thenav56

thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

All applied

❯ az postgres flexible-server parameter list \                                                                                                                                                                
  --subscription 39308fb0-9929-4b29-aafa-b3c78a8b0658 \
  --resource-group ifrctgo002rg \
  --server-name montandon-eoapi-staging-psql-flexible-server \
  --query "[?name=='shared_buffers'||name=='work_mem'].{name:name,value:value,default:defaultValue,unit:unit,source:source,dynamic:isDynamicConfig,pendingRestart:isConfigPendingRestart}" \
  -o table
Name            Value    Default    Unit    Source          Dynamic    PendingRestart
--------------  -------  ---------  ------  --------------  ---------  ----------------
shared_buffers  524288   524288     8kB     system-default  False      False
work_mem        65536    4096       kB      user-override   True       False
❯ az postgres flexible-server show \                                                                                                                                                                          
  --subscription 39308fb0-9929-4b29-aafa-b3c78a8b0658 \
  --resource-group ifrctgo002rg \
  --name montandon-eoapi-staging-psql-flexible-server \
  --query "{sku:sku.name,tier:sku.tier,storage:storage.storageSizeGb,tier2:storage.tier,iops:storage.iops,ha:highAvailability.mode}" -o jsonc
{
  "ha": "Disabled",
  "iops": 1100,
  "sku": "Standard_D4ds_v5",
  "storage": 256,
  "tier": "GeneralPurpose",
  "tier2": "P15"
}

@batpad

batpad commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@wrynearson - from @thenav56 's earlier comment: this has only been applied on staging. Have you been doing your tests against staging or prod?

@wrynearson

Copy link
Copy Markdown

Apologies, I missed that message. @pantierra on Slack debugged and deemed that this worked well.

@wrynearson

Copy link
Copy Markdown

@thenav56 I think this can also be deployed to prod (no need to rush today though). cc @pantierra

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.

4 participants