This week SQL Server 2016 Cumulative Update 1 was released and it contains a lot of updates/fixes for SSIS, SSAS, SSRS and MDS. If you are already working on SQL Server 2016, I’d urge to install this update as soon as possible.
Anyway, one of the particular updates that caught my attention was Adds the adjusted buffer size to the BufferSizeTuning event when AutoAdjustBufferSize is enabled in SSIS 2016. In simple terms, it allows you to log the size of the data flow buffer set automatically by the AutoAdjustBufferSize property. This property basically automatically calculates the buffer size needed to reach the amount of rows in the buffer specified by DefaultBufferMaxRows. Therefore, it ignores the DefaultBufferSize property. Unfortunately, this new property is set to false by default.
Back on topic: since the size of the buffer is calculated automatically for you, it might be interesting to know its final size, especially when doing some performance tuning. There are two options to get the log information:
Let’s take a look at the first one. When you execute a package in the SSIS Catalog, certain information is logged automatically to the Catalog. Which information is decided by the logging level. In order to view the size of the data flow buffer, you need to use the Verbose logging level. Keep in mind that this logging level should be used for debugging only, since it generates quite some logging overhead! I ran a very simple package and it already resulted in over 6400 rows of logging. When you take a look at the All Messages drillthrough of the All Executions report in the catalog, you can find the necessary information under the message type NonDiagnostic.
In the screenshot above, you can see that the buffer was adjusted to 50MB.
The other method is to enable logging inside the SSIS package itself. The data flow has a new custom event, called BufferSizeTuning:
When we run the package, the following message is logged:
The buffer size of buffer type 0 is automatically adjusted to 50160000 bytes.
Now, when we change the DefaultBufferMaxRows property from its default value of 10,000 to 20,0000, we can see the following message being logged:
The buffer size of buffer type 0 is automatically adjusted to 100320000 bytes.
In other words, the buffer sized doubled to 100MB to incorporate the increase in the number of rows per buffer. By the way, the package ran only a few seconds faster although more memory was used.
Conclusion: a very nice trick to the tool belt for some SSIS performance tuning. Don’t use the Verbose logging level too much though.
You can find all the session materials for the presentation "Indexing for Dummies" that was…
The slidedeck and the SQL scripts for the session Indexing for Dummies can be found…
You can find the slides of my session on the €100 DWH in Azure on…
I've used Logic Apps a couple of times over the past years for simple workflows,…
I'm giving two online sessions soon on virtual events that are free to attend. The…
I wanted to try out the new JSON index which is for the moment only…