Category: Monitoring

Community Tools Month: Using sp_WhoIsActive to Catch ASYNC_NETWORK_IO

When your SQL Server's top wait stat is ASYNC_NETWORK_IO, that indicates SQL Server is waiting on the app to ask for the next part of the result set.

This is a real pain in the rear to troubleshoot because often these waits happen for really short duration each time - think milliseconds, not seconds. It's an issue of death by a thousand cuts.

Read more about Community Tools Month: Using sp_WhoIsActive to Catch ASYNC_NETWORK_IO 10 comments — Join the discussion

How to Find Out Whose Queries are Using The Most CPU

You've got a bunch of users on the same SQL Server, and you wanna know who's using the most resources. SQL Server doesn't make this easy. You can query some management views to see which queries or databases have been using the most resources, but you can't intuitively tell which USERS are.

To solve this problem, we're going to use Resource Governor.

Read more about How to Find Out Whose Queries are Using The Most CPU 6 comments — Join the discussion

Get Alerted When Your SQL Server Restarts with sp_SendStartupEmail

When your SQL Server restarts, how do you find out?

I've seen a few senior DBAs do a really smart trick: they write a stored procedure to send them an email, and then they mark that stored procedure as a startup stored procedure so that it runs automatically whenever SQL Server starts up. (You could also try this with an Agent job scheduled to run at Agent startup, but ... Agent may not actually start.)

Read more about Get Alerted When Your SQL Server Restarts with sp_SendStartupEmail 25 comments — Join the discussion

Page Life Expectancy Doesn’t Mean Jack, and You Should Stop Looking At It.

Page Life Expectancy is a Perfmon counter that's supposed to track how long pages stay in memory before they get flushed out to make room for other pages that are needed instead.

Paul Randal has blogged this a few times, and rather than rehash 'em, I'd rather point you to a couple of his roundups:

Read more about Page Life Expectancy Doesn’t Mean Jack, and You Should Stop Looking At It. 28 comments — Join the discussion

Why Database Monitoring Tools Are So Hard to Interpret

SentryOne's Greg Gonzalez recently published a post about "Why Wait Stats Alone Are Not Enough." Sure, Greg's obviously biased towards his own monitoring tool, but his post is really well-written and fair. I want to explain the same story, but from a different (and simplified) angle.

Say we've got a really simple database server, and we start out with just one query that runs each day:

Read more about Why Database Monitoring Tools Are So Hard to Interpret 2 comments — Join the discussion

What Queries Does Microsoft’s CEIP Service Run On Your SQL Server?

You've seen the CEIP Service on your SQL Server, and you're wondering what queries it runs and how it sends that information back to Microsoft. I was wondering too, because I started seeing queries running that I didn't expect:

Ah-ha, the telemetry service, also known as SQLCEIP! Starting with SQL Server 2016, your database server phones home to Microsoft by default. I clicked on the sql_text to see what query was running:
[crayon-6a5e231bb38ac121177373/]

Read more about What Queries Does Microsoft’s CEIP Service Run On Your SQL Server? 88 comments — Join the discussion

SQL Server Perfmon counters that are still interesting in 2019

(Cross-posted from the PASS Blog.)

Years ago, my first go-to tool for performance tuning was Performance Monitor: it was available everywhere, worked in all versions, and gave me a lot of useful information without paying for a monitoring tool. Since then, I've moved on - wait stats are a much better starting point - but there are still 3 good Perfmon counters that I rely on.

Read more about SQL Server Perfmon counters that are still interesting in 2019 14 comments — Join the discussion

How to Troubleshoot Blocking and Deadlocking with Scripts and Tools

When you need to find which queries are blocking other queries, your decision comes down to when the blocking happened. Is it happening now, recently, or coming up soon? During a live emergency, start with sp_WhoIsActive. Adam Machanic's excellent free sp_WhoIsActive replaces Activity Monitor, sp_who, and sp_who2, and it's way more powerful. The documentation is extensive -…

Read more about How to Troubleshoot Blocking and Deadlocking with Scripts and Tools 2 comments — Join the discussion
Performance Tuning

What Do You Want to See in a Free Query Store Tool?

I love Query Plans
No seriously, I love digging into query plans. Even writing XQuery to dig into them in sp_BlitzCache. I was both honored and horrified to take over development of it from Jeremiah.

It's a beast, but it's my kind of beast. At around 4500 lines of code, when you want to make a change, well, &^%$ happens sometimes.
It used to make sense

Read more about What Do You Want to See in a Free Query Store Tool? 7 comments — Join the discussion

Logging Activity Using sp_WhoIsActive – Take 2

We've already covered how to log activity using sp_WhoIsActive, but I wanted to share how I've seen it done in the wild. The difference between the two methods is that this version logs everything to the same table and is for continuous activity logging (scheduled job), whereas the other version uses a new table each time it logs activity and is for when you are working on a problem.

Read more about Logging Activity Using sp_WhoIsActive – Take 2 47 comments — Join the discussion