Service Broker has a group of internal waits around startup, shutdown and its endpoints, and this page covers them together. The definitions are Microsoft’s:
BROKER_INIT: initializing Service Broker in each active database; it should occur infrequently. It waits a second between attempts.BROKER_MASTERSTART: waiting for the primary event handler of Service Broker to start; it should be very brief.BROKER_REGISTERALLENDPOINTS: initialising a Service Broker connection endpoint; very brief.BROKER_ENDPOINT_STATE_MUTEX: contention for the state of a connection endpoint, since changes to it are serialised.BROKER_SERVICE: the destination list for a target service being updated or reprioritised.BROKER_SHUTDOWN: a planned shutdown of Service Broker; very brief, if it happens at all.BROKER_CONNECTION_RECEIVE_TASK: waiting for access to receive a message on a connection endpoint, which is serialised.
Are They a Problem?
No. They are lifecycle and configuration machinery, active at startup, shutdown, endpoint changes and routing updates, and most of them are brief. Get Wait Statistics filters BROKER_INIT, BROKER_MASTERSTART, BROKER_REGISTERALLENDPOINTS, BROKER_SERVICE and BROKER_SHUTDOWN, but not BROKER_ENDPOINT_STATE_MUTEX or BROKER_CONNECTION_RECEIVE_TASK, which can show on a server with busy Broker endpoints.
When They Do Matter
Rarely. If an endpoint change seems to hang, these waits around a stuck ALTER ENDPOINT point at what is holding the endpoint busy.
Service Broker health lives elsewhere. Messages that cannot be delivered sit in sys.transmission_queue with a transmission_status explaining why, activation procedure errors go to the error log, and conversations that are never ended pile up in sys.conversation_endpoints. The baseline to monitor is the row count in those two views staying flat. Get Service Broker Health and Database Mail Queue checks both.
The BROKER Family
These are the Service Broker background waits. Most of them tick over on every instance, whether or not you use Broker, because the threads behind them always exist. If one is near the top of your waits, start from the waits that usually matter instead.
- BROKER_TO_FLUSHLazy flusher. Flushing in-memory transmission objects to a work table.Usually noise
- BROKER_TASK_STOPTask shutdown. The queue task handler shutting a task down.Usually noise
- BROKER_TRANSMITTERTransmitter idle. The two transmitter threads waiting for messages to send.Usually noise
- BROKER_TRANSMISSION_TABLETransmission table. Documented as internal use only; tied to transmission bookkeeping.Usually noise
- BROKER_TRANSMISSION_WORKTransmission work. Documented as internal use only.Usually noise
- BROKER_EVENTHANDLEREvent handler. The primary Broker event handler waiting for its next event.Usually noise
- BROKER_RECEIVE_WAITFORRECEIVE WAITFOR. A RECEIVE WAITFOR statement waiting for a message to arrive.Usually noise
- BROKER_INIT and startup waitsStartup and shutdown. Broker initialising in each database, and its endpoint and startup machinery.Usually noise. This page.
Where To Go Next
These Broker startup waits are background noise. If you are chasing a real problem, start with the waits that cost you time.
- The waits that usually matter, ranked, with what each one is telling you.
- Get Service Broker Health and Database Mail Queue, queues, transmission backlog and Database Mail in one check.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply