Daniel's Tech Blog

Cloud Computing, Cloud Native & Kubernetes

Cost optimize your Azure PostgreSQL Flexible Server deployments

As I am currently preparing my session for Experts Live Germany about Azure Cost Optimization, I thought it might be good to share parts of the session as blog articles with the community. So, expect more to come in the next weeks and months.

Today we focus on cost-optimizing Azure PostgreSQL Flexible Server deployments. Therefore, we look at the different compute SKUs, the performance tier feature, and the Premium SSD v2 support.

Compute SKU

When we look at the current compute SKU offering for the Flexible Server, we have the choice between V3, V4, and V5 for the General Purpose and Memory Optimized offerings. Between those compute SKU versions, depending on the workload, you have a major performance difference.

According to Microsoft, the V4 can be up to 40% faster than the V3.

“So, depending on your workload and your data size, you could expect up to 40% performance improvement with V4 series compared to V3.”

-> https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/flexible-server-now-supports-v4-compute-series-in-postgresql-on/ba-p/2815092?WT.mc_id=AZ-MVP-5000119

Up to 50% more performance is provided by the V5 compared to the V4.

“The addition of Intel V5 Ddsv5 and EdsV5 compute support for Azure Database for PostgreSQL Flexible Server in select regions takes performance to new heights offering 50% increase in core to memory ratio compared to the previous generation (V4 SKU).”

-> https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/introducing-intel-v5-compute-and-32-tb-storage-support-on-azure/ba-p/3839849?WT.mc_id=AZ-MVP-5000119

Let us look at the following table, where we compare the smallest General Purpose Flexible Server SKU versions against each other that offer two cores and 8 GB memory.

SKU version Performance improvement compared to the previous SKU version Compute instance Region Price per month (14.05.2024)
V3 D2s_v3 West Europe 139 €
V4 Up to 40% D2ds_v4 West Europe 145 €
V5 Up to 50% D2ds_v5
D2ads_v5
West Europe 145 €

The price difference per month is small in this example and gets bigger with larger instances. The interesting part, which is unfortunate, is the missing reservations for the V5 SKU version. So, the general advice regarding the SKU version is to switch from a V3 to a V4 or V5. Even it means you pay a bit more per month, the SKU version switch might save you from scaling the current instance to the next instance size, which would double the costs.

Performance Tier

Still in preview, the performance tier feature allows you to provide more IOPS and throughput to the currently selected disk size as it would have per default. Before that feature, you would have to scale to the next available disk size or an even larger one to achieve this, even if you do not need the additional disk space.

Depending on how much disk speed you need, you must scale the Azure PostgreSQL Flexible Server deployment to the next instance size, as this is then the limiting factor.

Azure Portal - PostgreSQL - Compute and Storage

The only downside of the performance tier feature is the cost increase. It is the same increase if you would scale to the next larger disk size. On the other hand, you can scale down the performance tier to the disk’s default one, which is not possible for the disk size. This makes the performance tier compelling again in scenarios where you only need additional performance for peak times.

Furthermore, the performance tier feature might be an intermediate solution for more disk performance where no increase in disk size is needed till Premium SSDs v2 are generally available for Azure PostgreSQL Flexible Server.

Premium SSD v2

Premium SSD v2 is another feature in preview for the Azure PostgreSQL Flexible Server but with a lot of limitations that do not make it compelling right now for every use case.

-> https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-storage?WT.mc_id=AZ-MVP-5000119#premium-ssd-v2-early-preview-limitations

But we are not here to talk about the limits. We want to understand what Premium SSD v2 improves for the Flexible Server deployments.

The Premium SSD v2 feature provides total flexibility in size, IOPS, and throughput. All three storage configuration options can be adapted independently from each other. Instead of choosing a preconfigured disk size, we can fine-tune the storage to the needs of the databases hosted by the Flexible Server.

Another advantage of the Premium SSD v2 option compared to the Premium SSD option is the better cost-performance ratio.

Let us have a look into an example Flexible Server configuration using the Standard_D2s_v3 compute SKU in Central US with the Premium SSD v2 option and without.

Azure Portal - PostgreSQL - Compute and Storage - Premium SSD v2 Azure Portal - PostgreSQL - Compute and Storage - Premium SSD

As seen above, both Flexible Servers have 128 GB storage and cost the same per month. Using the Premium SSD v2 option provides the Flexible Server constantly with 3000 IOPS and 125 MB/s throughput. The Premium SSD option only provides 500 IOPS and 100 MB/s throughput but can burst occasionally above these baseline values.

Azure Portal - PostgreSQL - Compute and Storage - Premium SSD v2 Azure Portal - PostgreSQL - Compute and Storage - Premium SSD

When we now want to have the performance of a P30 disk size, we scale IOPS and throughput on the Premium SSD v2 to 5000 IOPS and 200 MB/s throughput. The other Flexible Server can be scaled by increasing the disk size or using the performance tier feature. From a cost perspective, both options are the same. Comparing Premium SSDs v2 against Premium SSD, the Premium SSD v2 option saves us around 66 € per month.

Summary

The potential for the cost optimization of an Azure PostgreSQL Flexible Server deployment depends on the compute SKU. When running on compute SKU V3 or V4, there is an optimization potential available.

On the storage side, both features are in preview. The only real option right now is the performance tier, as Premium SSDs v2 have too many limitations at the moment. But the performance tier is only an interim solution till the general availability of the Premium SSD v2 feature.


Posted

in

WordPress Cookie Notice by Real Cookie Banner