Published on

March 5, 2016

Understanding SQL Server Throttling in Azure

In standalone versions of SQL Server, when the server receives more concurrent requests than it can handle simultaneously, it queues the requests for later processing. However, in SQL Azure Database, the behavior is different. Instead of queuing the requests, SQL Azure throttles or rejects the requests when the server becomes too busy. This is done to prevent cascading failures and ensure a basic service level for all users, regardless of the system load.

It’s important to note that SQL Azure throttling should not be confused with the SQL Server Resource Governor feature. Throttling is considered a design feature and is not a problem with the service or its availability. Properly designed applications for SQL Azure should have error handlers to trap throttling errors and retry the operation at a later time.

To understand if there are IO waits due to throttling, you can use Dynamic Management Views (DMVs) in SQL Server. For example, you can use the sys.dm_io_virtual_file_stats DMV to check for IO stalls. Here’s an example query:

SELECT type, SUM(io_stall_read_ms) AS io_stall_read,
SUM(io_stall_write_ms) AS io_stall_write,
SUM(num_of_reads) AS num_of_reads,
SUM(num_of_writes) AS num_of_writes
FROM sys.dm_io_virtual_file_stats(NULL, NULL) fs
JOIN sys.database_files df
ON fs.file_id = df.file_id
WHERE database_id = DB_ID()
GROUP BY df.type

In the above query, the stall values for reads and writes indicate if there are any throttling limits being hit. If the values are high, it suggests that the reads and writes are being throttled.

It’s worth mentioning that the throttling limits may vary depending on the version and tier of your SQL Azure Database. If you provision a higher Premier version, the limits might never be hit for small experiments like the one mentioned in the example.

If you are using Azure SQL databases for your applications, I would love to hear about your experiences. What are the typical applications that you have migrated to the cloud database? Please share your thoughts and experiences in the comments section.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.