Sp_BlitzWho can get blocked…?

All we need is an easy explanation of the problem, so here it is.

I was playing around with sp_BlitzWho and got blocked by another session. The session was from the DB were sp_BlitzWho is… I was planning to automate it and save the results to a table, so I could analyze the accumulated wait stats for different sessions (I have heard it does that in contrast to sp_WhoIsActive), but now it seems not to be such a good idea… Maybe it is better to just use sys.dm_exec_session_wait_stats or sp_WhoIsActive…?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

You have a couple of different questions in here.

Can sp_BlitzWho get blocked?

Yes, any query can. There are DMVs that are known to ignore isolation level requests and incur blocking.

Should I use sp_BlitzWho to log wait stats by session?

I wouldn’t recommend doing that on a scheduled basis, no. If you need wait stats by session, you’re better off with a traditional monitoring tool with a higher sampling rate. You wouldn’t want sp_BlitzWho running, say, every 5 seconds, but you really need data at that level of granularity if you want to analyze wait stats by session.

Why shouldn’t I log wait stats by session?

Because your server can be a victim of the death-by-a-thousand-cuts scenario: a query that runs thousands of times per second, each time darting in and out, and never accumulating that much wait time each time it runs. However, in total, it can add up to a big deal.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply