HADR_DATABASE_FLOW_CONTROL SQL Server Wait Type

Wait Type HADR_DATABASE_FLOW_CONTROL

The wait type HADR_DATABASE_FLOW_CONTROL is ranked #132 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.


In SQL Server, especially in high availability environments, wait types are useful for identifying where delays might occur. One wait type specific to Always On Availability Groups (AG) is HADR_DATABASE_FLOW_CONTROL. This wait type relates to the flow of data between primary and secondary replicas in an AG setup. If you see HADR_DATABASE_FLOW_CONTROL waits, it indicates SQL Server is controlling the rate of data transfer to maintain stability. Let’s break down what HADR_DATABASE_FLOW_CONTROL means, when it appears, and what it might indicate about your SQL Server performance.

What Is the HADR_DATABASE_FLOW_CONTROL Wait Type?

The HADR_DATABASE_FLOW_CONTROL wait type occurs in SQL Server when there is a delay in transferring data between the primary and secondary replicas in an Always On Availability Group. In this context, “flow control” refers to SQL Server slowing down or pausing the flow of data to secondary replicas to prevent them from becoming overwhelmed.

This wait type is a normal part of SQL Server’s mechanism to ensure data is consistently replicated to the secondary replicas. However, high or prolonged HADR_DATABASE_FLOW_CONTROL waits may indicate that secondary replicas are struggling to keep up with the primary replica.

When Does HADR_DATABASE_FLOW_CONTROL Appear?

You’ll typically see HADR_DATABASE_FLOW_CONTROL waits in Always On Availability Group environments where data is continuously being sent from the primary to secondary replicas. Common scenarios include:

  • High Data Modification Workloads – When the primary replica is handling a high volume of data changes, such as inserts, updates, or deletes, SQL Server may need to control the flow to prevent secondary replicas from falling behind.
  • Secondary Replica Performance Bottlenecks – If secondary replicas have slower hardware, limited CPU, or storage constraints, they may struggle to process incoming data, causing flow control waits on the primary.
  • Network Latency – Network issues between primary and secondary replicas can cause delays in data transfer, leading SQL Server to apply flow control to maintain consistency.

Why HADR_DATABASE_FLOW_CONTROL Waits Matter

While some HADR_DATABASE_FLOW_CONTROL waits are normal in Always On Availability Group environments, prolonged waits can signal potential issues. When SQL Server has to frequently slow down data transfer, it can impact the timeliness of data replication, meaning secondary replicas might not be fully synchronized with the primary. This can delay failovers and affect your disaster recovery strategy.

Common causes of high HADR_DATABASE_FLOW_CONTROL waits include:

  • Resource Limitations on Secondary Replicas – If secondary replicas lack adequate CPU, memory, or I/O capacity, they may struggle to keep up with data from the primary.
  • Network Issues – High latency or packet loss between replicas can slow down data transmission, resulting in more frequent flow control waits.
  • Heavy Workloads on the Primary – When the primary replica processes a high volume of transactions, it puts more pressure on the replication process, leading to flow control waits if the secondaries can’t keep up.

How to Address HADR_DATABASE_FLOW_CONTROL Waits

If you’re noticing high or persistent HADR_DATABASE_FLOW_CONTROL waits, here are some steps to help improve data flow between primary and secondary replicas:

  • Optimize Network Performance – Ensure that the network connection between replicas is stable and has low latency to reduce delays in data transmission.
  • Upgrade Secondary Replica Resources – Increasing CPU, memory, or I/O capacity on the secondary replicas can help them process incoming data faster.
  • Monitor Workload on the Primary – Identify and optimize high-volume transactions on the primary replica that may be contributing to increased flow control waits.
  • Consider Reducing Data Load – If feasible, consider reducing the workload on the primary replica during peak times or spreading out high-impact transactions.

Conclusion

The HADR_DATABASE_FLOW_CONTROL wait type is a natural part of SQL Server’s high availability system, helping manage data flow in Always On Availability Groups. While some waits of this type are expected, high or frequent waits can indicate that secondary replicas are struggling to keep pace with the primary. By optimizing network performance, upgrading secondary replica resources, and monitoring high-impact workloads, you can help reduce HADR_DATABASE_FLOW_CONTROL waits and improve the efficiency of your SQL Server high availability setup.

If you’re looking for assistance with Always On Availability Group tuning and SQL Server performance optimization, Stedman Solutions offers expert managed services to keep your SQL Server environment running smoothly and reliably.


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_COMPRESSED_CACHE_SYNC
    HADR_CONNECTIVITY_INFO
    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_DATABASE_FLOW_CONTROL SQL Server Wait Type