Database Instance Sizes
Overview
When deploying SFTP Gateway with a high availability (HA) configuration, we use
an external PostgreSQL Flexible Server. By default, we use Standard_B1ms
for
the instance size.
For scenarios involving larger workloads, you want to use a larger database
instance size (i.e. D2s_v3
). Although it costs more, the D2s_v3
instance
size supports more database connections, and can handle sustained
traffic.
Background
In our kb for launching an HA ARM template, the
default PostgreSQL database size is Standard_B1ms
. While this works for
most use cases, it becomes a bottleneck for larger workloads.
The issue may present itself as the VMs in the scale set reaching nearly 100% utilization. While at first it seems this is caused by heavy SFTP traffic, upon further inspection it's because the Java service on each VM is constantly failing. The specific Java errors indicate there is trouble reaching the database.
The Standard_B1ms
database instance size only supports 50 connections. This
can create a bottleneck for larger workloads, where VMs are unable to connect
to the database.
Database instance sizes
Here are some database instance sizes, along with a few key metrics:
B1ms
- 50 max connections
- $15 / month
B2s
- 429 max connections
- $30 / month
B2ms
- 859 max connections
- $60 / month
D2s_v3
- 859 max connections
- $70 / month
If your troubleshooting indicates that the database max connections is a
bottleneck, consider upgrading your database instance size to at least a B2s
.
If you have a heavy workload and need reliable performance, consider
upgrading to at least a D2s_v3
.
Editing the ARM template
In the ARM template, the PostgreSQL resource is found under this object:
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
In the object properties, the sku
defines the database instance size:
"sku": {
"name": "Standard_B1ms",
"tier": "Burstable"
},
The B
class uses the Burstable
tier.
If you want to use a D
class, you need to use the GeneralPurpose
tier:
"sku": {
"name": "D2s_v3",
"tier": "GeneralPurpose"
},