Performance Testing Series
This post is part of a series of blog posts about my performance tests in Azure SQL Database. For the first post in this series (and links to all of the other posts) please see here. For a summary of all the results please see here.
For a general overview of the test architecture, test components and test types, please see here.
Update Test Overview
The Update test involves calling a stored procedure to update single rows in a pre-populated test table.
The Cloud Service fires up a number of worker threads as specified in the test definition. Each worker thread picks a Row Id (primary key value) at random from an in-memory list of primary key values that exist in the database. The worker thread generates new values for all fields in the row except the primary key then calls a simple stored procedure to update that single row (see stored procedure definition at the bottom of the post here).
The worker threads in the UT tests are not limited to a specified request rate. As soon as an update stored procedure call has completed another is generated. The worker threads in the LT tests are constrained to generate requests at a limited rate specified in the test definition. The LT tests gradually increase the rate over the course of a number of tests.
Both the UT and LT Update tests run against only a small set of test data. This means the entire data set generally exists in the SQL Server Buffer pool (the test table is pre-populated immediately before the test begins). This test therefore primarily investigates write rates. In contrast to these tests, the later Scale Tests include updating data that is not always resident in the buffer pool.
UT Test Results
Results from the 30 UT Updates tests are shown in the two charts below. In these charts, the “T” values are the number of worker threads generating requests against the database, e.g. “Business 4T” = a test against Business edition, running with 4 threads continuously generating requests.
The two charts are similar because the average row size was around 400 bytes throughout. The data volume figures here are based on the data content (i.e. summing the sizes of the data values, according to the number of bytes each data value requires in the SQL Server Data Type scheme but ignoring internal SQL Server overheads).
Several different tests of the current Web/Business edition were carried out. The Web 1T test was carried out on a A1 sized cloud instance, the Business 1T test on an A2 sized instance. This explains the slightly higher throughput on the Business 1T test. As the number of threads was increased in the Business edition tests, the throughput increases though is variable.
From these results S2 generally equals or outperforms Business Edition. Interestingly, for this workload, the gap between S2 and P1 is not all that significant, but P2 is substantially better than P1 and towers above Business Edition.
I will demonstrate below that all of the test results for the new service tiers shown above are limited by the SQL Server Log Write Rate limit, i.e. this is the determining factor in the performance.
The charts below show the performance profiles over the lifetime of the tests in the charts above. Since 30 lines is rather a lot to fit onto one chart, data for the different editions / tiers has been split across several charts.
It is also worth noting that due to the way the Azure SQL Database logging into sys.resource_stats works, data is only available at five minute intervals and the last data point in each test (which would have been plotted as minute 27 in these charts) is often not useful and so is generally omitted.
Basic to P1 Tiers
Peformance of the new tiers is very consistent – other than a blip towards the end of one of the S2 tests. The charts show that these tests weren’t constrained on CPU but were clearly constrained on log write quota. All of the data was already present in the buffer pool during these tests – i.e. physical disk read quota had no impact.
Std2 to P2 Tiers
P2 follows the same pattern as the previously discussed tiers.
The SQL Server performance data (from sys.resource_stats) has a few data points missing on these charts. It appears as though a bug or infrastructure fault within Azure was preventing some usage data being processed correctly into the view.
Nonetheless, these profiles show the much more variable nature of the Business Edition. Those tests where multiple threads are executing show considerably more variable performance, sometimes varying wildly.
In addition, the Log Write profile looks suspiciously odd, being at 100% for all data points in all tests. More on this below.
LT Test Results
Three series of LT tests were carried out, against the Web, Basic and S1 editions / tiers.
The chart below illustrates how the performance of the Basic Tier varies as the workload (number of requests per second) is increased. A 30 minute test was conducted at each request rate.
As the request rate is increased, the CPU utilisation and log write utilisation increase. At around 60 rows per second, we have hit the log write limit and the database is not able to keep up with the request rate. All of the data for these tests was present in the buffer pool. Disk Read quota had no impact.
Performance is very consistent throughout.
This chart looks very different to the previous Basic Edition chart. Despite these tests always starting only a few minutes after the test data was created, the data is no longer resident in the buffer pool. All of these tests were constrained by the physical disk read rate. The maximum rate of 65 or so rows per second is considerably less than the 110 rows per second seen in the S1 UT test.
The web edition is slightly less consistent – i.e. we start to miss requests in a more rough and ready manner.
It is interesting to note that this chart also proves the well known fact that there is no clearly enforced log write limit per database in the Web Edition. I.e. we apparently hit the reported log write limit at 40 requests per second, but we can actually continue increasing our request rate to more than three times this “maximum” – i.e. to around 130 or 140 requests per second – before we actually see a significant number of requests failing to be processed.
Update Test Conclusions
The UpdateTests have shown that, for a workload of purely stored procedure based row-by-row updates (of average row size 400 bytes), performance of the new S2 / P1 tiers generally equals or exceeds the current Business Edition. P2 significantly outperforms Business for this workload.
The tests have also hinted at the impact limited physical disk read quota can have on performance. This is explored in the later Sequential Select and Scale Tests.
Appendix – UT Test Configuration
|Cloud Svc Inst. Size||A1||A2||A2||A2||A3||A1||A1||A2||A2||A2|
|Req. Gen. Thread Count||1||1||2||4||8||1||1||2||4||8|
|Initial Test Data (MB)||0.1||0.2||0.2||0.2||0.8||0.1||0.1||0.4||0.8||1.2|
Appendix – UT Test Results
|Configuration||Avg Rows Per Second||Avg MB Per Minute|
|Std S1 1T||115||119||120||2.46||2.53||2.55|
|Std S2 2T||237||231||231||5.06||4.93||4.92|
|Prem P1 4T||296||295||296||6.32||6.30||6.32|
|Prem P2 8T||589||586||585||12.55||12.50||12.49|
|Configuration||SQL Avg Log Write %||SQL Avg Disk Read %||SQL Avg CPU %|
|Std S1 1T||96.0||97.9||98.6||0.2||0.0||0.0||31.4||30.2||32.6|
|Std S2 2T||99.0||98.2||98.1||0.0||0.0||0.0||31.2||30.5||28.0|
|Prem P1 4T||99.8||91.7||99.8||0.0||0.0||0.0||12.8||11.0||12.4|
|Prem P2 8T||98.5||98.3||98.4||0.0||0.0||0.0||17.3||17.1||17.2|
|Configuration||Cloud Svc Avg CPU||Error Count|
|Std S1 1T||3.6||3.7||3.4||0||0||0|
|Std S2 2T||4.3||3.6||3.6||0||0||0|
|Prem P1 4T||4.2||4.2||4.4||0||0||0|
|Prem P2 8T||7.8||7.8||7.6||0||0||0|
Appendix – LT Test Configuration
|Cloud Svc Inst. Size||A0||A0||A0|
|Req. Gen. Thread Count||1||1||1|
|Initial Test Data (MB)||0.25||0.25||0.5|
Appendix – LT Test Results
|Threads||Req. Per Sec||Avg Rows Per Second||Avg MB Per Minute|
|Web||Basic||Std 1||Web||Basic||Std 1|
|Threads||Req. Per Sec||SQL Avg Log Write %||SQL Avg Disk Read %||SQL Avg CPU %|
|Web||Basic||Std 1||Web||Basic||Std 1||Web||Basic||Std 1|
The Requests per Second maximum applies in total, not per thread.