An Azure relational database service.
Your observed latency is expected with Azure SQL Hyperscale for small transactional workloads—Hyperscale is optimized for massive scale and throughput, not low-latency micro-inserts.
- Log write throughput limits: Hyperscale caps log write throughput around 100–150 MB/s per database, which can introduce delays for frequent small commits.
- Distributed architecture overhead: Hyperscale uses multiple replicas and page servers, so even trivial operations like
TRUNCATEand small inserts incur coordination costs. - Latency sensitivity: It’s designed for workloads with large datasets and analytical queries, not latency-critical OLTP micro-benchmarks.
To improve performance, you need to adjust your workload design or consider a different service tier.
- Change Service Tier
- For latency-sensitive OLTP workloads, General Purpose or Business Critical tiers often outperform Hyperscale for small inserts.
- Business Critical uses local SSDs and synchronous replicas, reducing commit latency.
- Batch Inserts
- Instead of inserting 10 rows individually, batch them into a single
INSERTstatement or use table-valued parameters. - This reduces round trips and log flushes.
- Instead of inserting 10 rows individually, batch them into a single
- Avoid Frequent Truncates
-
TRUNCATEin Hyperscale is metadata-heavy due to distributed storage. - Consider using
DELETEwith minimal logging or staging tables instead.
-
- Network Optimization
- Ensure your Azure VM and SQL Database are in the same region and availability zone.
- Use Accelerated Networking on the VM to reduce network jitter.
- Diagnostics & Monitoring
- Use Query Store and Hyperscale performance diagnostics to identify bottlenecks.
- Check if latency is dominated by log flushes or network hops.
https://learn.microsoft.com/en-us/azure/azure-sql/database/hyperscale-architecture?view=azuresql
https://learn.microsoft.com/en-us/azure/azure-sql/performance-improve-use-batching?view=azuresql