Making SQL Server Database Backups Faster with the Intel® QuickAssist Technology (QAT)

Hi guys,


I know, we already talked about Intel QuickAssist Technology when we talked about the new features that the new SQL Server 2022 introduces.

Briefly, using this technology  we are able to offload specific SQL Server workloads to hardware devices such as compressing a backup.

Yes, additional hardware is needed, but even without it we can still use this techonology because in this case QAT driver will use your CPU todo the work.

So this time is the right time for a benchmark!


Intro

Compressing a backup is a good idea because data inside a backup file (and even inside a database) is highly compressible, while overhead due to the compression time is usually acceptable.

When you backup a database you can choose to compress data that will be written inside the backup file. 

To do this just add the COMPRESSION option to the BACKUP T-SQL command:

Starting from SQL server 16.x (SQL 2022) the syntax is slightly changed and you can choose the compression algorithm used.

By default, the standard compression algorithm used since many many years is called MS_XPRESS.

If the Intel QAT driver is installed you can use the new QAT_DEFLATE algorithm to compress the backup: 

Without any hardware accelerator the compression of data will be executed in software mode using the CPU. 

However this new compression algorithm should be better than the old one.

A comparison between the two algorithms is awaiting you in the following paragraph!

Before that remember to install the QAT driver from the Microsoft homepeage and configure their usage through the followin script:


EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE
GO
EXEC sp_configure 'hardware offload enabled', 1;
GO
RECONFIGURE
GO

ALTER SERVER CONFIGURATION SET HARDWARE_OFFLOAD = ON (ACCELERATOR = QAT); 

Finally restart SQL  Server.


The compress a database benchmark

We for this benchmark we made a striped backup.
 
A striped backup is simply a database backup that has more than one backup file, so the backup data is spread evenly across the backup files. So, if you have two backup files, half of the data is in each backup file
 
T-SQL Commands executed are:

BACKUP DATABASE [SBODemoUS] TO  
DISK = N'C:\Luca\SBODemoUS21.bak', 
DISK = N'C:\Luca\SBODemoUS21a.bak',
DISK = N'C:\Luca\SBODemoUS21b.bak',
DISK = N'C:\Luca\SBODemoUS21c.bak'
WITH NOFORMAT
, NOINIT,  NAME = N'SBODemoUS-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, 
COMPRESSION (ALGORITHM = MS_XPRESS) ,  STATS = 10
GO

BACKUP DATABASE [SBODemoUS] TO  
DISK = N'C:\Luca\SBODemoUS31.bak', 
DISK = N'C:\Luca\SBODemoUS31a.bak',
DISK = N'C:\Luca\SBODemoUS31b.bak',
DISK = N'C:\Luca\SBODemoUS31c.bak'
WITH NOFORMAT
, NOINIT,  NAME = N'SBODemoUS-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, 
COMPRESSION (ALGORITHM = QAT_DEFLATE) ,  STATS = 10
GO
        
The results are:

Average value 10 executions
 
  • MS_XPRESS 4,783 seconds
  • QTA_DEFLATE 2,423 seconds
 

 
The new algorithm is therefore in this specific case double faster! 

 
 
That's all for today, I wish a great week end!
~Luca 
But remember:
 

 
 



















Previous post: SQL Server, the new malware Maggie is infecting hundreds of SQL Servers

Comments

I Post piĆ¹ popolari

SQL Server, execution plan and the lazy spool (clearly explained)

SQL Server, datetime vs. datetime2

How to solve EXECUTE Permission denied on object 'sp_send_dbmail'