HADR_COMPRESSED_CACHE_SYNC SQL Server Wait Type

Wait Type HADR_COMPRESSED_CACHE_SYNC

The wait type HADR_COMPRESSED_CACHE_SYNC is ranked #124 by Stedman Solutions and Database Health Monitor.

Wait statistics, in the context of SQL Server, refer to the amount of time that a query spends waiting to access data in the database. When a client application requests data from the database, the request is placed in a queue and the client application must wait for its turn to access the data. The time that the query spends waiting is called a "wait" and is tracked by SQL Server. This information can be used to identify potential performance bottlenecks and optimize the performance of the database. Wait statistics are commonly used by database administrators to diagnose and troubleshoot performance issues in SQL Server.


SQL Server Always On Availability Groups provide powerful high availability and disaster recovery capabilities, but they also introduce unique wait types that administrators should understand. One such wait type is HADR_COMPRESSED_CACHE_SYNC. Knowing what it represents and how to address it can help maintain a reliable and high-performing environment.

What is HADR_COMPRESSED_CACHE_SYNC?

The HADR_COMPRESSED_CACHE_SYNC wait type occurs in Always On Availability Groups when SQL Server is synchronizing compressed log records between the primary and secondary replicas. This wait type specifically pertains to the cache of compressed data, which is used to optimize the transfer of transaction logs across replicas.

In simpler terms, this wait type shows that SQL Server is busy ensuring compressed log records are synchronized to keep your replicas up-to-date. While some wait time is normal, excessive HADR_COMPRESSED_CACHE_SYNC waits could indicate bottlenecks in the compression or synchronization processes.

Why Does HADR_COMPRESSED_CACHE_SYNC Happen?

There are several reasons why HADR_COMPRESSED_CACHE_SYNC waits might occur, including:

  • High transaction log generation on the primary replica, increasing the volume of compressed data.
  • Resource bottlenecks on the primary or secondary replicas, such as CPU or memory constraints.
  • Slow or unreliable network connections between replicas, causing delays in synchronization.
  • Insufficient disk I/O performance on the secondary replicas, impacting the ability to apply log records.
  • Suboptimal Always On Availability Group configurations.

Identifying the root cause of these waits can help improve the performance and reliability of your Always On setup.

How to Monitor HADR_COMPRESSED_CACHE_SYNC Waits

To track and analyze HADR_COMPRESSED_CACHE_SYNC waits, monitoring tools like the Database Health Monitor are invaluable. Its Historic Waits Monitoring feature provides detailed insights into SQL Server wait types, including this one, helping you identify patterns and correlations with system activity.

Using Database Health Monitor, you can determine if these waits are occurring during specific workloads or at times of high resource usage. This data enables you to make informed decisions to resolve issues effectively.

What Can You Do About HADR_COMPRESSED_CACHE_SYNC Waits?

If you notice frequent or prolonged HADR_COMPRESSED_CACHE_SYNC waits, here are steps you can take:

  • Review and optimize queries and indexes to reduce transaction log generation on the primary replica.
  • Ensure the network between the primary and secondary replicas has low latency and sufficient bandwidth for log synchronization.
  • Upgrade or optimize CPU, memory, and disk I/O resources on both primary and secondary replicas.
  • Evaluate your Always On Availability Group configuration to ensure it matches your workload and performance requirements.
  • Distribute workloads across secondary replicas to balance resource usage and avoid contention.

These actions can help reduce HADR_COMPRESSED_CACHE_SYNC waits, improving the overall efficiency of your Always On environment.

How Stedman Solutions Can Help

At Stedman Solutions, we specialize in SQL Server performance tuning and troubleshooting, including resolving issues with wait types like HADR_COMPRESSED_CACHE_SYNC. Our managed services provide expert support to ensure your Always On Availability Groups are optimized and reliable. Additionally, our Database Health Monitor offers robust tools to track and analyze SQL Server waits, giving you the insights needed to maintain peak performance.

If your Always On environment is experiencing performance challenges or you want to optimize your SQL Server setup, contact us today. Let us help you achieve a fast, reliable, and efficient database environment!


Find out more about our SQL Server Managed Services

Applies to

    Related Waits

    HADR_AG_MUTEX
    HADR_AR_CRITICAL_SECTION_ENTRY
    HADR_AR_MANAGER_MUTEX
    HADR_AR_UNLOAD_COMPLETED
    HADR_ARCONTROLLER_NOTIFICATIONS_SUBSCRIBER_LIST
    HADR_BACKUP_BULK_LOCK
    HADR_BACKUP_QUEUE
    HADR_CLUSAPI_CALL
    HADR_CONNECTIVITY_INFO
    HADR_DATABASE_FLOW_CONTROL
    HADR_DATABASE_VERSIONING_STATE
    HADR_DATABASE_WAIT_FOR_RESTART
    HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING
    HADR_DB_COMMAND
    HADR_DB_OP_COMPLETION_SYNC
    HADR_DB_OP_START_SYNC
    HADR_DBR_SUBSCRIBER
    HADR_DBR_SUBSCRIBER_FILTER_LIST
    HADR_DBSEEDING
    HADR_DBSEEDING_LIST
    HADR_DBSTATECHANGE_SYNC
    HADR_FABRIC_CALLBACK
    HADR_FILESTREAM_BLOCK_FLUSH
    HADR_FILESTREAM_FILE_CLOSE
    HADR_FILESTREAM_FILE_REQUEST
    HADR_FILESTREAM_IOMGR
    HADR_FILESTREAM_MANAGER
    HADR_GROUP_COMMIT
    HADR_LOGCAPTURE_SYNC
    HADR_LOGCAPTURE_WAIT
    HADR_LOGPROGRESS_SYNC
    HADR_NOTIFICATION_DEQUEUE
    HADR_NOTIFICATION_WORKER_EXCLUSIVE_ACCESS
    HADR_NOTIFICATION_WORKER_STARTUP_SYNC
    HADR_NOTIFICATION_WORKER_TERMINATION_SYNC
    HADR_PARTNER_SYNC
    HADR_READ_ALL_NETWORKS
    HADR_RECOVERY_WAIT_FOR_CONNECTION
    HADR_RECOVERY_WAIT_FOR_UNDO
    HADR_REPLICAINFO_SYNC
    HADR_SYNC_COMMIT
    HADR_SYNCHRONIZING_THROTTLE
    HADR_TDS_LISTENER_SYNC
    HADR_TDS_LISTENER_SYNC_PROCESSING
    HADR_TIMER_TASK
    HADR_TRANSPORT_DBRLIST
    HADR_TRANSPORT_FLOW_CONTROL
    HADR_TRANSPORT_SESSION
    HADR_WORK_POOL
    HADR_WORK_QUEUE
    HADR_XRF_STACK_ACCESS

    See Also


    All Wait Types
    HADR_COMPRESSED_CACHE_SYNC SQL Server Wait Type