|
1 | 1 | --- |
2 | | -title: "Tune compression for availability group" |
3 | | -description: Learn how SQL Server compresses data streams for availability groups, which reduces network traffic, increases CPU load, and may induce latency. |
| 2 | +title: Tune compression for availability group |
| 3 | +description: Learn how SQL Server compresses data streams for availability groups, which reduces network traffic, increases CPU load, and might induce latency. |
4 | 4 | author: MashaMSFT |
5 | 5 | ms.author: mathoma |
6 | | -ms.date: "06/22/2016" |
| 6 | +ms.reviewer: randolphwest |
| 7 | +ms.date: 01/25/2024 |
7 | 8 | ms.service: sql |
8 | 9 | ms.subservice: availability-groups |
9 | 10 | ms.topic: conceptual |
10 | 11 | --- |
11 | 12 | # Tune compression for availability group |
12 | | -[!INCLUDE [SQL Server](../../../includes/applies-to-version/sqlserver.md)] |
13 | | -By default, SQL Server compresses data streams where appropriate for availability groups. Compression reduces network traffic, increases CPU load, and may induce latency. You must be a member of the sysadmin fixed server role to enable compression. The following table shows when SQL Server uses compression for availability group log streams: |
14 | | - |
15 | | -| Scenario | Compression Setting |
16 | | -| ---- | ---- |
17 | | -| Synchronous-commit replica | Not compressed |
18 | | -| Asynchronous- commit replicas | Compressed |
19 | | -| During automatic seeding | Not compressed |
20 | | -| TDE enabled in database | Not compressed |
21 | 13 |
|
22 | | -## Trace flags for availability group compression |
23 | | - |
24 | | -For most scenarios Microsoft does not recommend changing these settings. You can use global trace flags to test changing these settings. SQL Server applies global trace flags to the entire instance. All of the availability groups in the instance will be affected by these settings. |
| 14 | +[!INCLUDE [SQL Server](../../../includes/applies-to-version/sqlserver.md)] |
25 | 15 |
|
26 | | -The following table shows trace flags that will change the default compression behavior for SQL Server. |
| 16 | +By default, SQL Server compresses data streams where appropriate for availability groups. Compression reduces network traffic, increases CPU load, and might induce latency. You must be a member of the **sysadmin** fixed server role to enable compression. The following table shows when SQL Server uses compression for availability group log streams: |
27 | 17 |
|
28 | | -Trace flag | Description |
29 | | -------------- | ------------- |
30 | | -1462 | Disables log stream compression for Availability Groups with asynchronous replicas. This feature is enabled by default on asynchronous replicas to optimize network bandwidth. |
31 | | -9567 | Enables compression of the data stream for Availability Groups during automatic seeding. During automatic seeding, compression can significantly reduce the transfer time and will increase the load on the processor. |
32 | | -9592 | Enables log stream compression for Availability Groups with synchronous replicas. This feature is disabled by default on synchronous replicas because compression adds latency. Log stream compression is enabled by default for asynchronous replicas. |
| 18 | +| Scenario | Compression setting | |
| 19 | +| --- | --- | |
| 20 | +| Synchronous-commit replica | Not compressed | |
| 21 | +| Asynchronous-commit replicas | Compressed | |
| 22 | +| During automatic seeding | Not compressed | |
| 23 | +| TDE enabled and asynchronous-commit in database | Compressed | |
| 24 | +| TDE enabled and synchronous-commit in database | Not compressed | |
33 | 25 |
|
| 26 | +## Trace flags for availability group compression |
34 | 27 |
|
35 | | -## Resources |
| 28 | +For most scenarios, we don't recommend changing these settings. You can use global trace flags to test changing these settings. SQL Server applies global trace flags to the entire instance. All of the availability groups in the instance are affected by these settings. |
36 | 29 |
|
| 30 | +The following table shows trace flags that change the default compression behavior for SQL Server. |
37 | 31 |
|
38 | | -[Database Engine Startup Options](../../../database-engine/configure-windows/database-engine-service-startup-options.md) |
| 32 | +| Trace flag | Description | |
| 33 | +| --- | --- | |
| 34 | +| 1462 | Disables log stream compression for availability groups with asynchronous replicas. This feature is enabled by default on asynchronous replicas to optimize network bandwidth. | |
| 35 | +| 9567 | Enables compression of the data stream for availability groups during automatic seeding. During automatic seeding, compression can significantly reduce the transfer time, and increase the load on the processor. | |
| 36 | +| 9592 | Enables log stream compression for availability groups with synchronous replicas. This feature is disabled by default on synchronous replicas because compression adds latency. Log stream compression is enabled by default for asynchronous replicas. | |
39 | 37 |
|
40 | | -[Automatic Seeding](./automatically-initialize-always-on-availability-group.md) |
| 38 | +## Related content |
41 | 39 |
|
42 | | -[Always On Prerequisites](prereqs-restrictions-recommendations-always-on-availability.md) |
| 40 | +- [Database Engine Service startup options](../../configure-windows/database-engine-service-startup-options.md) |
| 41 | +- [Use automatic seeding to initialize an Always On availability group](automatically-initialize-always-on-availability-group.md) |
| 42 | +- [Prerequisites, restrictions, and recommendations for Always On availability groups](prereqs-restrictions-recommendations-always-on-availability.md) |
0 commit comments