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:
Why HADR_DATABASE_FLOW_CONTROL Waits MatterWhile 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:
How to Address HADR_DATABASE_FLOW_CONTROL WaitsIf 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:
ConclusionThe 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.
Applies toRelated WaitsHADR_AG_MUTEXHADR_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 AlsoAll Wait Types |