Change the Service Plan
Move a Managed PostgreSQL service to a larger or smaller plan, and know in advance what the change does to the connections of your application. The plan sets the node count, the node size and the disk; changing the plan is how you change any of the three.
Prerequisites
- The Exoscale CLI, configured with your API credentials.
- A running Managed PostgreSQL service.
- For a smaller plan, enough disk on the target plan for the data you already store. The rules that apply to every DBaaS engine are on Scale DBaaS services.
Choose the Target Plan
List the plans with their node count, vCPUs, memory and disk:
exo dbaas type show pg --plansThe # NODES column gives the node count: one node for hobbyist-* and startup-* plans, two
for business-*, three for premium-*. Plans with AUTHORIZED set to false require an
authorization before you can use them.
Read the plan the service runs today:
exo dbaas show SERVICE_NAME -z ZONEParameters:
SERVICE_NAME: name of the Managed PostgreSQL service, for examplemy-postgresql.ZONE: zone the service runs in, for examplech-gva-2.
Change the Plan
exo dbaas update SERVICE_NAME -z ZONE -f --plan PLANParameters:
SERVICE_NAME: name of the Managed PostgreSQL service.ZONE: zone the service runs in.PLAN: the target plan, for examplestartup-8.-f: applies the change without the confirmation prompt. Without it, a non-interactive shell applies nothing.
The command returns immediately. Follow the state until it is running again:
exo dbaas show SERVICE_NAME -z ZONEThe state moves to rebalancing while the platform builds the new nodes, then back to
running. On a small service, moving from hobbyist-2 to startup-4 and back took about three
minutes each way.
Moving to a smaller plan is accepted as long as the data fits: a startup-4 service (80 GiB of
disk) holding a small database moved down to hobbyist-2 (8 GiB).
What a Plan Change Does to Your Connections
The hostname and port of the service stay the same, so clients keep their connection URI. The IP address behind the hostname changes when the node is replaced.
When the node size changes, the platform builds a new node while the old one keeps serving, then switches to it in one step:
- Every session open on the old node ends with
FATAL: terminating connection due to administrator command. - New connections fail for a few seconds, then succeed on the new node.
- The data, users, databases, connection pools and service settings are unchanged.
Tip
Schedule a plan change at a time when a few seconds of reconnection are acceptable, and make sure the application opens a new connection when one dies. A client-side pool that validates connections before handing them out absorbs the switch.
Moving to a plan with more nodes of the same size adds standby nodes to the service. See High availability for what the standbys do.