Introduction

SQL Server 2025 introduces a new algorithm for backup compression: ZSTD. As a result, SQL Server 2025 now offers three solutions for backup compression:

  • MS_XPRESS
  • QAT
  • ZSTD

In this blog, we will compare MS_XPRESS and ZSTD.

Environment

To perform these tests, the following virtual machine was used:

  • OS: Windows Server 2022 Datacenter
  • SQL Server: 2025 Standard Developer
  • CPU: 8 cores
  • VM memory: 12 GB
  • (SQL) Max server memory: 4 GB

Additionally, I used the StackOverflow database to run the backup tests (reference: https://www.brentozar.com/archive/2015/10/how-to-download-the-stack-overflow-database-via-bittorrent/).

ZSTD usage

There are several ways to use the new ZSTD compression algorithm. Here are two methods:

  • Add the following terms to the SQL backup commands: WITH COMPRESSION (ALGORITHM = ZSTD)
BACKUP DATABASE StackOverflow TO DISK = 'T:\S1.bak' WITH INIT, FORMAT, COMPRESSION (ALGORITHM = ZSTD), STATS = 5
  • Change the compression algorithm at the instance level:
EXECUTE sp_configure 'backup compression algorithm', 3; 
RECONFIGURE;

The initial data

The StackOverflow database used has a size of approximately 165 GB. To perform an initial test using the MS_XPRESS algorithm, the commands below were executed:

SET STATISTICS TIME ON
BACKUP DATABASE StackOverflow TO DISK = 'T:\S1.bak' WITH INIT, FORMAT, COMPRESSION, STATS = 5;

Here is the result:

BACKUP DATABASE successfully processed 20 932 274 pages in 290.145 seconds (563.626 MB/sec).
SQL Server Execution Times: CPU time = 11 482 ms,  elapsed time = 290 207 ms.

For the second test, we are using the ZSTD algorithm with the commands below:

SET STATISTICS TIME ON
BACKUP DATABASE StackOverflow TO DISK = 'T:\S1.bak' WITH INIT, FORMAT, COMPRESSION (ALGORITHM = ZSTD), STATS = 5

Here is the result:

BACKUP DATABASE successfully processed 20 932 274 pages in 171.338 seconds (954.449 MB/sec).
CPU time = 10 750 ms,  elapsed time = 171 397 ms.

It should be noted that my storage system cannot sustain its maximum throughput for an extended period. In fact, when transferring large files (e.g., 100 GB), the throughput drops after about 15 seconds (for example, from 1.2 GB/s to 500 MB/s).

According to the initial data, the CPU time between MS_XPRESS and ZSTD is generally the same. However, since ZSTD allows backups to be performed more quickly (based on the tests), the overall CPU time is lower with the ZSTD algorithm. Indeed, because the backup duration is reduced, the time the CPU spends executing instructions (related to backups) is also lower.

Comparison table for elapsed time with percentage gain:

Test NumberCompression TypeDuration In Seconds
1MS_XPRESS290
2ZSTD171
PerformanceApproximately 41% faster

Comparison of captured data

During the tests, performance counters were set up to gain a more accurate view of the behavior of the two algorithms during a backup. For this, we used the following counters:

  • Backup throughput/sec (KB)
  • Disk Read KB/sec (in my case, Disk Read KB/sec is equal to the values of the Backup Throughput/sec (KB) counter). In fact, the “Backup throughput/sec (KB)” counter reflects the reading of data pages during the backup.
  • Disk Write KB/sec
  • Processor Time (%)

We observe that the throughput is higher with the ZSTD algorithm. The drop that appears is explained by the fact that ZSTD enabled the backup to be completed more quickly. As a result, the backup operation took less time, and the amount of data collected is lower compared to the other solution. Additionally, it should be noted that the database is hosted on volume (S) while the backups are stored on another volume (T).

We also observe that the write throughput is higher when using the ZSTD algorithm.

For the same observed period, the CPU load is generally the same however ZSTD allows a backup to be completed more quickly (in our case). As a result, the overall CPU load is generally lower.

We also observe that the backup ratio (on this database) is higher with the ZSTD algorithm. This indicates that the size occupied by the compressed backup is smaller with ZSTD.

backup_ratiodatabase_namebackup_typecompressed_backup_size (bytes)compression_algorithm
3.410259900691847063StackOverflowFull50 283 256 836MS_XPRESS
3.443440933211591093StackOverflowFull49 798 726 852ZSTD

Conclusion

Based on the tests performed, we observe that the ZSTD algorithm allows:

  • Faster backup creation
  • Reduced CPU load because backups are produced more quickly
  • Reduced backup size

However, it should be noted that further testing is needed to confirm the points above.

Thank you, Amine Haloui.