|
| 1 | +--- |
| 2 | +title: Scaling Resources in Azure Database for PostgreSQL - Flexible Server |
| 3 | +description: This article describes the resource scaling in Azure Database for PostgreSQL - Flexible Server. |
| 4 | +author: varun-dhawan |
| 5 | +ms.author: varundhawan |
| 6 | +ms.service: postgresql |
| 7 | +ms.subservice: flexible-server |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 12/01/2023 |
| 10 | +--- |
| 11 | + |
| 12 | +# Scaling Resources in Azure Database for PostgreSQL - Flexible Server |
| 13 | + |
| 14 | +[!INCLUDE [applies-to-postgresql-flexible-server](../includes/applies-to-postgresql-flexible-server.md)] |
| 15 | + |
| 16 | +Azure Database for PostgreSQL = Flexible Server supports both vertical and horizontal scaling options. |
| 17 | + |
| 18 | +You scale vertically by adding more resources to the Flexible server instance, such as increasing the instance-assigned number of CPUs and memory. Network throughput of your instance depends on the values you choose for CPU and memory. Once a Flexible server instance is created, you can independently change the CPU (vCores), the amount of storage, and the backup retention period. The number of vCores can be scaled up or down. The storage size however can only be increased. In addition, uou can scale the backup retention period up or down from 7 to 35 days. The resources can be scaled using multiple tools for instance [Azure portal](./quickstart-create-server-portal.md) or the [Azure CLI](./quickstart-create-server-cli.md). |
| 19 | + |
| 20 | +> [!NOTE] |
| 21 | +> After you increase the storage size, you can't go back to a smaller storage size. |
| 22 | +
|
| 23 | +You scale horizontally by creating [read replicas](./concepts-read-replicas.md). Read replicas let you scale your read workloads onto separate flexible server instance without affecting the performance and availability of the primary instance. |
| 24 | + |
| 25 | +When you change the number of vCores or the compute tier, the instance is restarted for the new server type to take effect. During this time the system switches over to the new server type, no new connections can be established, and all uncommitted transactions will be rolled back. The overall time it takes to restart your server depends on the crash recovery process and database activity at the time of the restart. Restarts typically takes a minute or less but it can be higher and can take several minutes, depending on transactional activity at the time of the restart. Scaling the storage does not require a server restart in most cases. Similarly, backup retention period changes is an online operation. To improve the restart time, we recommend that you perform scale operations during off-peak hours. That approach reduces the time needed to restart the database server. |
| 26 | + |
| 27 | +## Near-zero downtime scaling |
| 28 | + |
| 29 | +Near-zero Downtime Scaling is a feature designed to minimize downtime when modifying storage and compute tiers. If you modify the number of vCores or change the compute tier, the server undergoes a restart to apply the new configuration. During this transition to the new server, no new connections can be established. Typically, this process with regular scaling could take anywhere between 2 to 10 minutes. However, with the new 'Near-zero downtime' Scaling feature this duration has been reduced to less than 30 seconds. This significant reduction in downtime during scaling resources, that greatly improves the overall availability of your database instance. |
| 30 | + |
| 31 | +### How it works |
| 32 | + |
| 33 | +When updating your Flexible server in scaling scenarios, we create a new copy of your server (VM) with the updated configuration, synchronize it with your current one, briefly switch to the new copy with a 30-second interruption, and retire the old server, all at no extra cost to you. This process allows for seamless updates while minimizing downtime and ensuring cost-efficiency. This scaling process is triggered when changes are made to the storage and compute tiers, and the experience remains consistent for both (HA) and non-HA servers. This feature is enabled in all Azure regions and there is **no customer action required** to use this capability. |
| 34 | + |
| 35 | +> [!NOTE] |
| 36 | +> Near-zero downtime scaling process is the _default_ operation. However, in cases where the following limitations are encountered, the system switches to regular scaling, which involves more downtime compared to the near-zero downtime scaling. |
| 37 | +
|
| 38 | +#### Pre-requisites |
| 39 | +- In order for near-zero downtime scaling to work, you should enable all inbound/outbound connections between the IPs in the delegated subnet. If these are not enabled near zero downtime scaling process will not work and scaling will occur through the standard scaling workflow. |
| 40 | + |
| 41 | +#### Limitations |
| 42 | + |
| 43 | +- Near-zero Downtime Scaling will not work if there are regional capacity constraints or quota limits on customer subscriptions. |
| 44 | +- Near-zero Downtime Scaling doesn't work for replica server but supports the primary server. For replica server it will automatically go through regular scaling process. |
| 45 | +- Near-zero Downtime Scaling will not work if a VNET injected Server with delegated subnet does not have sufficient usable IP addresses. If you have a standalone server, one additional IP address is necessary, and for a HA-enabled server, two extra IP addresses are required. |
| 46 | + |
| 47 | +## Related content |
| 48 | + |
| 49 | +- [create a PostgreSQL server in the portal](how-to-manage-server-portal.md) |
| 50 | +- [service limits](concepts-limits.md) |
0 commit comments