top of page

Everything You Need to Know about Head Blockers

Sometimes SQL Server becomes very busy, to the point that nothing moves and everything is stuck. This is usually when people starting to shout and say nasty words.


In many cases, it happens because there is a long blocking chain. It means that some task is waiting for something (disk, memory, external process, etc.), let's call it Resource A, while holding a lock on some other resource, let's call it Resource B. Other tasks that need access to Resource B are blocked. Maybe one of these tasks is already holding a lock on Resource C, so another task might be blocked behind that resource, and so on.


If the first task has to wait for a long time, then the blocking chain might become very long, and everything becomes stuck. When this happens, you want to identify that first task as quickly as possible, understand what it's doing and what it's waiting for, and release the blocking chain. That first task is called the Head Blocker.


You can release the blocking chain by either resolving the wait on which the head blocker is waiting and let it finish and released its locks. You can also simply kill the head blocker, although this can be risky, because it might need to roll back a lot of work, and during that time the blocking chain will not be released.


Recently I encountered such a use case, and I needed a good script to identify the head blocker. There are plenty of scripts out there to identify the head blocker, but I couldn't find a single one that gave me all the information I needed.


Some scripts output the entire blocking chain, which can include thousands of rows. In most cases, this data is useless. I'm only interested in the head blocker and some aggregated data about the size of the blocking chain.


Some scripts give you the head blocker but fail to include all the information about it, such as the query text and the wait type.


Some scripts identify only one head blocker, but sometimes there are multiple blocking chains at the same time. I would like to see all of them, and by comparing the aggregated data (e.g. the blocking chain length), I can take a decision on which blocking chain and head blocker I should concentrate my efforts.


You've probably guessed by now where this is going. I wrote my own version of Head Blockers script, and I put in in our Madeira Toolbox on GitHub. This script identifies all the head blockers that exist now in your instance along with a lot of useful troubleshooting information about the task each one of them is currently running.


The script also produces some aggregated data about each blocking chain: the chain length, the number of blocked tasks, and the number of blocked sessions.


You can find the script here.

5 Comments


dycig
5 days ago

A clear and well-organized breakdown of a technical topic that could otherwise feel overwhelming. The step-by-step explanations made it easy to follow, even for readers without deep prior knowledge. I noticed a similar clarity in a review blog discussing phonydiploma where simplifying complex ideas made a big difference. Content like this is genuinely helpful.

Edited
Like

hyfejany
5 days ago

This was an excellent breakdown of a complex topic, presented in a way that’s easy to understand even for non-specialists. The logical flow and clear explanations made the subject much more approachable. I’ve seen a comparable educational style in informative posts related to https://grandoaksorthodontics.com/, where simplifying technical concepts really helps readers feel informed rather than intimidated. Very well done.

Like

cycuvixu
Dec 16, 2025

Really informative article — you explained head blockers in a clear and accessible way without overcomplicating the technical side. This kind of breakdown is incredibly useful for people trying to understand the topic properly. I recently read a comparable analysis on an attn2detail review blog https://www.attn2detail.info/ and it’s great to see data topics being made more approachable like this.

Like

jemyqu
Dec 16, 2025

This was a very clear and practical guide — I really appreciated how you broke down the concept of head blockers and provided actionable steps for identifying them in SQL Server. It’s rare to find posts that balance technical depth with readability so well. I recently came across a similar discussion on a https://thesagelawgroup.ca/ review blog, and it offered some interesting perspectives on troubleshooting complex issues too.

Like

Guest
Jun 18, 2025

32win – nền tảng dành cho cả người mới lẫn dân chơi chuyên nghiệp Ưu đãi siêu to, thắng cực đã tại https://32winn.uk.com/

Like

STAY IN TOUCH

Get New posts delivered straight to your inbox

Thank you for subscribing!

bottom of page