Categories: SSIS

An update on AutoAdjustBufferSize in SSIS 2016

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:

  • Run the package using the Verbose logging level.
  • Add a custom log provider to the package and log the new custom BufferSizeTuning event of the data flow.

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.


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂
Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

Recent Posts

Book Review – Microsoft Power BI Performance Best Practices

I was asked to do a review of the book Microsoft Power BI Performance Best…

3 days ago

Create a Numbers Table in Power Query

This is a quick blog post, mainly so I have the code available if I…

7 days ago

Microsoft finally adds Tenant Switcher for Fabric / Power BI

Praise whatever deity you believe in, because it's finally here, a tenant switcher for Microsoft…

1 week ago

Book Review – Humanizing Data Strategy by Tiankai Feng

This book was making its rounds on social media, and the concept seems interesting enough…

1 week ago

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

I'm hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM UTC.…

3 weeks ago

dataMinds Connect 2024 – Session Materials

The slides and scripts for my session "Tackling the Gaps & Islands Problem with T-SQL…

1 month ago