Tag Archive: fave

Bottlenecks and Bank Balances

Pop quiz: should you be worried if your SQL Server’s page life expectancy is averaging 214?

There’s only one correct answer: it depends.  Successful performance tuning boils down to a simple cycle:

  • Measure the application’s performance
  • Find the current bottleneck
  • Improve that bottleneck so that it’s not the bottleneck anymore
  • Measure to find out how much your application performance improved
  • Ask the application owner if it’s good enough now. If so, move on to the next application. If not, go back to step 2.

And every one of those steps is equally important.

If You Don’t Find the Right Bottleneck

The Bottleneck Is Plenty Big Enough for You

This Bottleneck Is Plenty Big Enough for You

Performance tuning isn’t about zooming in and focusing on a single number in incredible detail; rather, it’s about stepping away and getting the full picture. Time and again, I get emails asking about whether a single metric is OK, but upon questioning, the DBA has leapt to a conclusion without surveying the environment as a whole. If you spend your tuning time closely examining a single metric, trying to figure out how to improve that one metric, you might not improve the performance of your application.

Sure, your page life expectancy might be pretty bad – but is that the one thing keeping your application from performing faster?

Take a step back and gather a complete set of Perfmon metrics. Look at CPU, memory, disk, and network performance as a whole. Find the thing that’s in the absolute worst shape possible. In that link, I explain the order that I look at metrics to find which one looks like the most likely bottleneck.

If You Don’t Focus on Improving the Bottleneck

I was recently working with a client frustrated with their application performance. I found two issues:

  • CPU-intensive user-defined functions were being called thousands of times per query
  • The storage subsystem was nowhere near as fast in practice as the vendor had claimed

The application’s bottleneck was the CPU-intensive UDFs. The server was frequently pegged at 100% CPU, and queries just couldn’t run any faster until they were rewritten to rip out the UDFs. I put together a recommended plan of action to take those UDFs out, which would make the application an order of magnitude faster. I noted that they should probably start working on the storage performance in a second track, because the instant the UDFs were removed, storage was going to become a problem. With the CPU-burning UDFs out of the way, the server would be able to churn through more records faster, but the storage subsystem wouldn’t be able to deliver records fast enough to satisfy the users.

On our next status update call, they said they’d reworked the storage subsystem. SQLIO reported dramatically faster storage throughput, but they were only seeing a minor improvement in application performance. I had to break the bad news to them that they’d focused on the wrong problem first. After we revisited my report together, they pursued the UDFs with renewed vigor, and suddenly the application was blazing fast. Thankfully I’d documented my findings in writing, but if I’d have been an internal employee, I might have communicated that in verbal form instead. I might have lost the ensuing battle to fix the UDFs because the manager would have thought my advice was bogus.

If You Don’t Measure Your Improvements

You Get What You Measure

You Get What You Measure

All DBAs are consultants.

Some of us think we’re full time company employees, but in reality, we’re delivering a service. Whether they’re developers, project managers, end users, or other DBAs, they’re looking at you just as if you were an outsider. You’re expected to stride in, identify the problem, mitigate it, and show that your work delivered a return on investment. The investment, in case you’re not following, is your paycheck.

Don’t believe me? Poke around in an application and then throw up your hands, saying you can’t find a way to make it go faster. The next phone call the project manager makes will be to an external consultant, and the project manager probably won’t call you first next time. (Sometimes, that’s not a bad thing.)

If you put in a lot of hard work to make an application go faster, but you don’t measure the before-and-after effects of your work, someone else is going to take credit. The developers will say the improvements were due to a new version of their code, because they’re working on the code at the same time you’re working on the database. The sysadmins will say they defragged the muffler bearings. The SAN guy will say he tweaked the flux capacitor. The project manager will say he made everybody worked long hours and that did the trick. The only way, the ONLY way that the DBA can ever take credit is to take clear before-and-after measurements for proof. Run the same code base before & after your tweaks, and measure application performance. Follow up with a written report, even if it’s a one-paragraph email, summing up your changes and the performance improvements, and copy your manager on it.

If You Don’t Ask the App Owner If It’s Good Enough

Never confuse what YOU think about a metric with what the BUSINESS thinks about a metric. Your CEO doesn’t care about page life expectancy. (Your CEO probably doesn’t even care about the DBA’s life expectancy.) Before you spend time or money improving an application, you have to find out whether it’s the most important thing to your business right now.

Say hello to the most important metric you will ever calculate: opportunity cost.

A Long Night at Zig Zag Has Its Own Opportunity Cost

A Long Night at Zig Zag Has Its Own Opportunity Cost

Opportunity cost is the cost of doing something as compared to the cost of doing something else. If you spend eight hours today improving the page life expectancy of a particular server, is that worth more to the business than anything else you could be doing in those eight hours? Could you spend eight hours doing something more valuable?

I use opportunity cost whenever anyone asks me to do something.

As an employee, if a project manager asks me to tune a particular application, I bring them into my manager’s office and say, “It will take me three days to make that application faster. I’ll probably make it an order of magnitude faster, because I’ve never tuned that server before. However, if I take those three days to do it, I won’t make the deadline for Project Snazzywidget. Which one is worth more to you?” At that point, it’s a political decision and a business decision, not a technical decision. If you’re doing the best job of any employee he has, your manager will put you on the most valuable project – which in turn increases your worth again.

As a consultant, I approach the problem differently: “Here’s the thing – I could spend another three days working on this application, but from this point forward, I’m only going to be able to achieve incremental improvements, not the order-of-magnitude improvements we saw in the first few rounds of tuning. I hate to make you guys go through that for a small gain – but is there another application in-house that isn’t delivering the performance you want?” This resets the client’s expectations, and they start seeing you as a weapon that they can point at slow applications. They’ll cherish your time and focus you where your effort will pay off the most. This keeps your perceived ROI high. If you deliver jawdropping results each time you tune an application, you can justify higher billable rates.

After all – isn’t your bank balance the one metric you really want to improve?

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Microsoft SQL Azure: The Flat Pack Database

Last weekend, Erika and I stumbled across a coffee table at Ikea that we liked much more than we’d expect for a $50 table.

The Finished Product

The Finished Product

Erika has champagne tastes; she can walk into any store and find the highest-priced item without ever seeing the price tags.  She’s just drawn to expensive stuff.  She’s had her eye on a $1,000 marble-top cocktail table (they’re not called coffee tables anymore, don’t ya know) from Room & Board for months.  Therefore, it was a complete shock when we both really liked this $50 table with exactly the same lines and shape, but a simple white veneer top instead of marble.

$950 savings?  Sold.

Granted, we won’t be passing this table down to our grandchildren, but we don’t even plan on having kids, let alone grandkids.  And this table might not last ten years, but at $50 a pop, we could buy a new one every five years for 100 years straight.  Odds are, our tastes will change over the course of the next 100 years, too.

The catch with Ikea is that the stuff is flat packed – the table comes in a flat box.  You’re responsible for hauling it through the aisles of the store, getting it home in your car, and assembling it yourself.  I’ve done this enough over the years that it doesn’t stress me out (anymore).  My tips for a successful Ikea build are:

  • Read the instructions three times – which is pretty simple, since they’re pictures, not words
  • Use an electric screwdriver to avoid exertion
  • Drink your favorite alcoholic beverage in moderation during assembly
  • Whenever you’re about to curse, stop to think about how much money you saved
  • When you’re done, don’t stand on it to test it

All of those are equally important.

If you don’t read and reread the directions, it’s very easy to end up with a desk that shakes when you type on it – and I happen to be typing on one of those at this very moment.  If you don’t use an electric screwdriver, your arms will be tired before you get halfway through, and you’ll strip out the screw heads.  If you don’t drink, you won’t be mellow enough to laugh at the pictures in the directions.  If you don’t constantly remind yourself of how much money you saved, you’ll be picking up the phone to call Crate & Barrel.

And finally, unless you bought a piece of furniture that was specifically designed for you to stand on, then it wasn’t.  Don’t stand on it to prove a point, because more often than not, you’ll prove that it wasn’t designed with standing in mind.

Ikea Table - Before

Ikea Table - Before

SQL Server is the Marble Coffee Table

When you’re building a brand-new product, company, or web site on the Microsoft stack, SQL Server Enterprise Edition is the sexy marble-top cocktail table.  That’s the one you really want, baby.  You just know all your friends will ooh and aah when you bring ‘em over for the opening night party and say, “Yeah, I built it with SQL Server.”

“But it’s so expensive!” they’ll say.

“Yeah, but my app is worth it.  SQL Server Enterprise Edition scales like there’s no tomorrow.  Built-in backup compression, partitioning, database mirroring, active/active clustering, and all that stuff those MySQL guys can only dream about.  We’re ready for the future now, baby.  Want another glass of champagne?  My venture capital guy bought us a couple dozen cases of the good stuff.”

Riiight.  Back to reality.

SQL Azure is the Flat Pack Database

Much like Ikea furniture, Microsoft SQL Azure is a cheap way to get a reasonable facsimile of the database you really want, but can’t justify buying.

There’s drawbacks:

  • Backups are not included – if you want to get your data out, get out your electric screwdriver and build it yourself
  • Scaling is not included – you have to roll your own sharding, and frankly, I don’t know anybody who does a good job of that
  • Database mirroring, partitioning, clustering, and batteries are not included
  • You can’t stand on it – don’t use this for your data warehouse or high-throughput databases, because the data goes through your internet connection

But if you can live with those drawbacks and build your own HA/DR solution – just like you dragged home your Ikea coffee table and assembled it yourself – you can save a lot of money.

Both SQL Server and Azure can – and will – coexist.  Heck, Ikea furniture happily coexists with the good stuff in my house too.  Now, if you’ll excuse me, I’ll go refresh the Crate & Barrel web site to see when my dining room table and chaise lounge are going to arrive.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

How to Get a Better Job

One of the most common questions I get goes something like this:

I’ve been working as an (insertJobHere) for a few years, and I’d like to start looking for another job as an (insertBetterJobHere).  How can I get started?

It depends on the phase of your career.

Phase 1: The Kindness of Strangers

When you’re just getting started – whether you’re fresh out of college or currently enrolled – you’re not going to know anybody.  You’re going to be cold-calling strangers, sending your resume to people you’ve never met, and hoping that you can knock ‘em dead in the interview.

Headhunter Company Car

Headhunter Company Car

Examples of hiring methods for Phase 1 are:

  • Newspaper and online ads
  • Recruiters
  • Consulting companies

There’s two problems with Phase 1.  First, you’re going up against complete strangers.  People in Phase 1 are desperate, and they’ll do some crazy stuff to beat you out in the job hunt.  They’ll work for less money, they’ll lie about their resume, they’ll use their mom as a reference, you name it.  Getting a better job when you’re going up against strangers can be a nightmare.

Second, you’re going to work for complete strangers, which can be a living hell.  You won’t find out that they’re raving lunatics until after you’ve already quit your current job and gone to work for them.  Every time I’ve gone to work for strangers – every single time – I’ve regretted it within a matter of months.

Strangers hire other strangers when they run out of friends willing to work for them.

Phase 2: The Buddy System

After you’ve been working for a few years, going to local user group meetings, and survived a few reorgs, you’re going to know a lot of other people working in your same field.  You’ll even know people in unrelated fields.  DBAs meet project managers, end users, report writers, developers, and so on.

Everybody Loves the Buddy System

Everybody Loves the Buddy System

When it’s time for you to start looking for another job, you can put out the word among your contacts.  Because they’ve worked with you before and they know what a kick-ass worker you are, they’re likely to vouch for you.  They’re likely to tell you about jobs before they go into Phase 1 recruitment, because they’d rather hire you than a stranger.  You’re a sure bet, because you’re doing such good work.

The only way to get from Phase 1 to Phase 2 is staying in touch with people.

I can’t emphasize this enough – if you don’t learn to network, you’re going to be permanently stuck in Phase 1.

Networking sounds so slimy, but it just boils down to this: meet people, and keep in touch with the ones you genuinely like.  I used to think networking meant rubbing shoulders with greaseballs who were trying to sell each other stuff, but that’s not true at all.  Just keep in touch with people you like, and go to the places where they hang out to meet more people like them.  For database professionals, that’s the upcoming PASS Summit.

Befriend Buddies, Not Just Bosses

One fast way up the corporate ladder is to hitch your wagon to a rising star.  If you do great work for a great boss, you can both go places quickly.  I’ve taken that approach a few times in my career, and it’s served me really well.  I remember getting a call from one boss as soon as he’d changed companies, and he said, “I know what you’re making now.  I’ll give you an extra $X to come work for me at the new shop, and you know I’ll be good to you.”  Sold.  However, that’s not the only way up.

The programmer next to you today might be the CIO at another company tomorrow.  A few years ago, Matt Mullenweg was just another guy I ran into at Houston Wireless meetings.  I had no idea he was building something cool in his spare time, and since then, that little blogging platform has raised tens of millions of dollars in funding.

Look around you right now.  Your coworkers and customers are the only ones who will take your career to the next level, regardless of how unskilled and antisocial they seem.  Even if they’re really, really bad at what they do, it’s your job to make them look better and leave a permanent positive impression on them.  They might be your key to a better job down the road.

If you wait to network until you need a job, it’s too late – and you’ll be stuck in Phase 1.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

SQL Server Data Compression: It’s a Party!

When I was in high school, Dad and I lived with his mom, my Grandma Ozar, for a couple of years.  We took care of things around the house and made sure her coffee pot was always full.  She could really down that coffee – at least two pots a day.  (Looking back, if we could have reduced her caffeine consumption, she probably wouldn’t have needed so much Valium.)

I Can Quit Anytime I Want*

I Can Quit Anytime I Want*

Grandma and some friends took a road trip to Las Vegas, and while they were gone, I threw an epic party.  We’re talking 30 gallon garbage cans filled with homemade Jungle Juice.  (I’m one of those reasons she couldn’t completely eliminate the Valium.) A couple hundred of my closest friends had a good old time.

A couple of my less-than-closest friends had a little too good of a time at my expense and started trashing the house.  They walked up the staircase smashing the picture frames of every family photo, then started to throw a couch off the second floor balcony.  My security guys (I’m telling you, it was that good of a party) carried them out before they got too carried away.

Cleaning Up After The Party

The next morning, the very-closest-friends did a fantastic job of getting things back to normal.  We replaced all the picture frame glass, got the dirt out of the sofa, vacuumed the place top to bottom, and finished the Jungle Juice.  I thought we’d hidden all our tracks, but we got busted by the tiniest of clues.

Someone had left beer bottle caps on top of door jambs all around the house.

Amazing!  Who thinks of this stuff?  You know they did it on purpose, too – they were just itching to get me into trouble.  One beer cap on one door jamb, I could understand, but all over the house?  Damn.

I was disinherited for that particular shindig.

I learned a valuable lesson: if you’re not absolutely sure you can clean up every trace of everybody else’s messes, you shouldn’t throw parties.  Sooner or later, somebody you can’t trust is going to show up at your party, and they’re going to do something that’ll get you in trouble.  Come to think of it, it’s just like being a DBA.

SQL Server 2008 Data Compression: No Inheritance Either

Microsoft SQL Server 2008′s Data Compression feature lets you compress objects – not just tables, but individual indexes.  This compression does incur a little extra CPU power to handle the compression, but that extra overhead is more than offset by increased IO performance.  Generally speaking, the database server is sitting around waiting on disk subsystems.  Adding a little CPU work while dramatically reducing IO needs results in faster query return times.  You need to test compression to see if it works well in your environment, because it may not work well in heavy-insert databases.

Today, though, I’m going to focus on the dark side of compression: a complete lack of inheritance.

When you compress tables and indexes, it’s a one-time action.  You’re only taking care of what exists today.  If someone (or even you) turns around and creates an index on that same table tomorrow, it won’t be compressed by default.  Whoever creates the index has to make sure that it’s compressed, and there’s nothing in SQL Server Management Studio that will hint to them that other parts of that same object are compressed.

To make matters worse, your development, QA and production environments might all have different compression settings, and you’d never notice it at a glance.  Compression is transparent to applications, so your developers won’t know why one environment performs much differently than another even though they have the same hardware, same indexes, same statistics.

Implementing compression is a multi-step process:

  • Figure out what objects you should compress
  • Plan to handle all of your environments (dev, QA, production)
  • Compress them during a low-activity window
  • Regularly patrol your environments checking for added objects that weren’t compressed
  • Keep your environments in sync

If you don’t stay on top of all of these, you’ll need Valium too.

* – Yes, about that picture.  No, it’s not mine.  Yes, it’s licensed with Creative Commons.  No, it wasn’t even the worst jungle juice picture I could find licensed with Creative Commons.  Yes, I too am amazed that people upload their party pictures to Flickr, let alone license them with Creative Commons.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

The Ozar Family Tradition of Performance Monitoring

When my Grandpa Ozar wanted to find out if his 10 megabyte 5.25″ hard drive was responding fast enough to handle his database loads, he monitored the Perfmon counter Physical Disk: Disk Queue Length. This metric told him how many requests that the 486sx/33 processor had sent off to the hard drive that hadn’t come back yet. Average disk queue lengths greater than 2 meant that the hard drive wasn’t quite keeping up.

How My Grandpa Ozar Met Grandma Ozar (No, Not Really)

How My Grandpa Ozar Met Grandma (No, Not Really)

To fix performance problems, Grandpa upgraded to RAID arrays with multiple hard drives. When his end users complained that his array of 9 gigabyte SCSI drives weren’t returning their queries quickly, he still monitored that same Disk Queue Length metric. He interpreted the results differently, though, because he had multiple drives in each array. He multiplied the old 2-queue-length guideline times the number of drives he had in the array. A RAID 5 array with 8 drives might be underperforming if the queue lengths averaged 16 or more. At night, Grandpa followed Usenet debates about whether to include the parity drive, and how to handle differences between read and write queues on RAID 10.

Dad Started Using a Stopwatch

By the time Dad started getting involved in system administration, Storage Area Networks (SANs) had made things complicated. He couldn’t count the number of drives in a particular array because that number kept changing, and those drives were shared between multiple servers. In a SAN, a twenty-drive RAID 10 array might be shared between a couple of database servers and a file server with different load patterns, different peak load hours, and different capacities.

Instead of measuring queue lengths, Dad watched response times. He used Avg Disk Seconds per Read to find out how long the SAN took to return data back to the Pentiums, and he referred to Microsoft’s published guidelines for OLTP and OLAP expected response times for reads and writes. Just finding out if drives were “fast enough” meant finding out what kinds of databases were involved and what they were doing, which made things confusing for end users.

The New New Way: Wait Stats

While I’d like to think my family line has been carefully bred for systems administration abilities, the reality is that I’m the product of decades of hospitality industry work in close proximity to large quantities of alcohol. Mercifully, systems administration has changed over time to be less math-oriented and more logic-oriented.

To find out what to tune, ask a simple question: what’s the server waiting on?

I love me some Perfmon metrics, but more and more database administrators are turning to a different way of performance tuning: wait statistics. SQL Server tracks what it spends time waiting for, and analyzing those statistics are the most efficient way to find the bottleneck. Who cares if the storage takes 10 or 100 milliseconds to return data from a particular query – the more important question is, was SQL Server waiting during that time, or was it working on something else anyway?

This is especially important in the age of virtualization and consolidation. Corporate management is less concerned about achieving the best possible performance, and more concerned about Good Enough. We have to be very careful to spend money only on the components that will truly make an order-of-magnitude performance difference, and not throw away money on things that will only make an incremental improvement.

Wanna learn how to measure performance with wait stats? Here’s my recommended reading:

After wait stats, what’s the future of performance management? I have no idea – but I’m the end of the Ozar family line anyway.

(Note – I’m on vacation, so I probably won’t be responding to comments for a few days. I scheduled this post ahead of time. I’m on a sailboat in Lake Michigan, and I’ll respond if I get within wireless range. And yes, I’m bringing my laptop.)

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Why Your Servers Need a Physical

I’ve been really lucky so far: I hardly ever get sick.

Steak Tartare

Steak Tartare

Every now and then, I engage in risky eating behavior and I come down with food poisoning. I should know better, but I just can’t help myself when I get the chance to try steak tartare, sushi, deep fried goat cheese or a Popeye’s #2 Extra Spicy, all of which have given me food poisoning. Yes, I know what Food Best Practices is, and generally I do a decent job of eating right, but who doesn’t fall off the wagon now and then?

Years of experience (including days in hotel bathrooms) have taught me how to handle basic health problems like a cold, a flu, or the aftermath of eating raw steak. I don’t usually see a medical professional for those symptoms. I know how to address those myself, and I can nurse myself back to health.

Nonetheless, once a year I shuffle into a doctor’s office in perfectly good health in order to get a physical and blood tests. The doc uses his skills and expensive equipment to find things about to go wrong – hopefully while they’re easy to catch and fix. At my last physical, for example, we determined that I was starting to suffer from GERD. My doctor explained how to handle it, and now I’m equipped to keep an eye on it and do preventative maintenance to ward it off. Without help from my doctor, I wouldn’t have been prepared, and I would have suffered some nasty problems down the road.

Your SQL Server Needs a Physical Too

As a database administrator, you’re better equipped than most people to handle database health problems. You do an above-average job of staying current with news and tips from other DBAs, and you understand a lot about how your systems work. If you’re like me, you know much more about what makes a database server tick than how your own body works. (My own medical knowledge comes exclusively from the game Amateur Surgeon, in which a pizza delivery guy uses a pizza cutter and salad tongs to get the job done.)

Please remove your clothes and wait for the DBA.

Please remove your clothes and wait for the DBA.

Don’t get overconfident, though: despite your SQL Server skills, you’re probably still a nurse, not a doctor. Even though you spend a lot of your spare time reading up on how to be a better database administrator, you don’t get the benefit of hands-on experience with the latest and greatest health technologies and techniques. While getting medical attention from a nurse is still better than a pizza delivery guy, it’s still no substitute for seeing a doctor.

Enter the SQL Server Health Check: a visit from a highly experienced consultant. Relax – there’s no paper gown involved. A consultant comes to your office for a few days or longer, uses a series of exotic scripts and tools on your server, and delivers an exhaustively detailed report. The resulting information tells you what’s going right and what’s going wrong, plus what you need to nip in the bud before it becomes an expensive disaster. I blogged about my Microsoft health check experience a couple of years ago, saying:

“I would highly recommend that anyone with a Premier Support agreement get a SQL Health Check. Even if you’re not having problems with your database servers, you’ll walk away with a useful set of knowledge about how to verify that everything’s functioning as it should.”

I’m still surprised by how few people are aware of the health check process, but the other DBAs who’ve done it have given it glowing reviews too. At the recent Quest Customer Advisory Board meetings, several of us shared our health check experiences and I learned about a new source for health checks: Solid Quality Mentors. Microsoft’s health checks are only done for Microsoft Premier customers, which tend to be large enterprise shops, but even small companies can get a SQL Server health check from SolidQ.

Health Checks Are Like a Blood Test

All of us have our own ways to poke around and find out if our server is doing okay, but we don’t have the skills or time to really dive deep. Microsoft and Solid Quality have invested thousands of hours into building very complex auditing tools that look into every nook and cranny of your server configuration and schema. I was stunned during my health check to see the number of things covered in such a short amount of time, and the consultant was kind enough to show me the contents of one of the auditing scripts. My jaw hit the floor – I just couldn’t believe how much logic was built into the tool.

After my health check finished, my first thought was to go build my own auditing script. I took a shot at it, but I quickly gave up because of the amount of time required. I’m glad I did, too, because I never would have been able to match it.

Only one local doctor takes my health insurance plan.

Only one local doctor takes my health insurance plan.

See, these companies continually strengthen their auditing tools based on feedback from their consultants. As they’re brought in to resolve performance problems, they learn new obscure issues faced by database administrators. They build scripts to check for the symptoms and add these scripts into the health check auditing tool. Something that might have taken days or weeks to stumble across now takes just seconds, and it happens automatically as part of the health check audit. When you get a health check, you’re taking advantage of the knowledge gained from consulting gig the company’s performed in the past. That’s like a blood testing machine: it’s crazy expensive, and us nurses can’t afford to have that kind of gear sitting around the house. Sure, an individual blood test only takes a matter of minutes, but think about how much skill and money it took to get there.

My generous, magnificent and good-looking employer, Quest Software, sells tools like Spotlight and Foglight Performance Analysis that do some of this same kind of analysis, so at first glance we look like competitors – not at all. Health checks are reasonably priced, but you probably can’t afford to have a full-time, round-the-clock expert from Microsoft or SolidQ watching all of your database servers. Quest’s tools give you that 24/7 insight into your servers so that when problems pop up, you can investigate and fix it immediately. Health checks are planned engagements that dive deeply into all aspects of a server’s performance, looking at areas our tools can’t reach. For example, we don’t investigate the number of indexes per table, which is something that SolidQ checks. I believe that even if you have all of the Quest tools, you’ll still benefit from getting a regular health check on your most important or worst-performing servers. (Hopefully those aren’t the same ones.)

As much as I’m gushing about health checks, you might think I’m getting paid for this endorsement. I’m purely doing this out of the goodness of my heart. I remember vividly how much I liked my health check and how much it expanded my knowledge, and if I was a DBA, I’d want to know this kind of option was out there.

How to Get a SQL Server Health Check

Begin by scoping out how many blood tests your server needs. Health checks can examine:

  • Hardware configuration
  • Windows configuration
  • SQL Server configuration
  • Database schema & queries

Choose which ones of those is most important to you first, and communicate that to the consultants as a part of the price quote process. That’ll help the consultants figure out the right person for your needs and build a timeline that will be long enough to accomplish your goals. For example, my first health check solely focused on the Windows and SQL Server configuration because the application team was convinced the problem wasn’t their queries.

After your team has agreed on a basic scope, contact Microsoft Premier Services or Solid Quality Mentors to find out how much it’ll cost.  In large cities, you may also have local consulting options too, but make sure the consultant has real-world experience with a lot of servers.  Don’t get a SQL Server database engine health check from someone who’s spent the last year managing an SSRS deployment, for example – their skills won’t be up-to-date with the latest performance and configuration techniques.  (If you’re reading this and your company offers these types of health check services, feel free to add a comment below this post with your web site & contact info.)

Scoping your health check doesn’t mean the consultant will completely ignore any other aspects, though. In my health check, after reviewing Windows and SQL Server, the consultant did a brief review of the database and showed why no hardware, OS or SQL Server changes would be able to accommodate the application – it needed serious reworking. The final health check report didn’t go into any depth on the schema or how to mitigate its problems, but the overall report was enough information to tell us what to do next.

The CAB members echoed my favorite part about an external health check; it’s like getting a second opinion from another doctor. As the in-house DBA, you may have been preaching the same story over and over to your developers and Windows admins. You may have been telling them for months/years/decades that they need to rewrite a particular cursor or they shouldn’t put TempDB on the C drive. Bringing in an independent outsider to take an objective look at your system and give an impartial report can help you effect the changes you’ve always wanted. There’s nothing more empowering than sitting in a conference room while the final report is discussed and saying, “See, I told you guys this was a problem, and now we can work to fix it together.”

Health Checks Are Training In Disguise

Health checks aren’t just ammo for the blame game – they’re also DBA training cleverly disguised as consulting costs. You’re having a hard time getting training money approved, right? Try getting a health check approved instead, but don’t tell your boss it’s actually training, muhahaha. I learned more during my one-week health check than I’d learned the rest of the year. Health checks at your office are great learning tools because they use your own servers as the examples. Instead of learning about theoretical problems with AdventureWorks samples, you’re learning things that are directly applicable to your own environment.

Before the consultant comes on site, block out your calendar for the health check dates. Plan to spend every available minute with the consultant to suck their brain dry. Even when they’re just sitting around waiting for results to come in, you should take advantage of their presence. Ask them about their recent horror stories at other shops and how they fixed the issues. Ask them what they like to look for first when examining performance problems. Listen and learn.

If I had the choice between going to a week of training versus getting a one-week health check on my nastiest database servers, I’d opt for the health check. The health check kills two birds with one stone: it shows me what’s wrong with my servers, and shows me how to correct it.

(Note – I’m on vacation, so I probably won’t be responding to comments for a few days. I scheduled this post ahead of time. I’m on a sailboat in Lake Michigan, and I’ll respond if I get within wireless range. And yes, I’m bringing my laptop.)

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Stunt Car Drivers, Eggs Benedict, and You

Wanna be the best at what you do?

Start paying attention to more than just “what you do.”

What Ken Block Does

Ken Block is a rally car driver, which means he slides cars around dangerous obstacles at high speed with great precision.  Thing is, though, lots of people can do that.  Standing out in a field of adrenaline junkies means going above and beyond the job description and giving your fans a truly amazing experience.  He recently did a video with James “Captain Slow” May of Top Gear, and it’s quite a watch – even just to hear James May say the phrase “Facetube.”  While watching, it may help to know that May is also a pilot with his own planes, so he may be especially nervous at the thought of sliding sports cars around someone else’s planes.

At about four minutes in, Block slides his Subaru alongside a taxiing airplane.

That’s amazing.

It’s amazing for his car control, but to just see the car control alone is missing the point. It’s impressive not just for how incredibly difficult it is, but also for how entertaining it is.  The whole is more than the sum of its parts, and what Ken Block “does” as a rally car driver is just one small part of this video.  It’s about stunts, it’s about humor, it’s about timing, it’s about moviemaking, and more.  Sure, Ken Block wins trophies, but paying attention to these kinds of details make him money.  People are willing to shell out big bucks when you get every part of the experience right, and I’ll give you an example from my upcoming travels this month.

Molecular Gastronomy: Stunt Cooking

Eggs Benedict at WD-50

Eggs Benedict at WD-50

The phrase “molecular gastronomy” might sound like food for geeks, but that’s missing the point.  The chefs might be geeks, but you don’t have to be geeky in order to appreciate the food.  Rather, molecular gastronomy is food for people who like to watch stunt car drivers.

On July 29th, I’m going to have a fourteen-course dinner, and one of the courses will be Eggs Benedict.  It’s going to look like the picture shown here.  (Hopefully.)

I know what you’re thinking: “Brent, you’re an idiot.  That’s not Eggs Benedict.”  Exactly – in the same way that what Ken Block is doing isn’t driving.  If you suspend skepticism for a minute and zoom in on that food, you’ll see that it’s chock full of stunts.

Sauce is a liquid.  Liquids, by their very nature, can’t be deep fried, right? You can’t take a lump of mayo, drop it into a deep fryer, and expect anything recognizable to emerge, no matter how thoroughly you coat that lump in bread crumbs.  But see those little cubes in the picture?  That’s deep fried hollandaise sauce.  See the cylindrical column?  Egg yolk.  The razor-thin sheet of something?  That’d be bacon.

Deep frying liquid is a stunt – but that alone doesn’t make good eats.  You have to have a reason to deep fry the liquid, the reason being a final result dish that is somehow in desperate need of deep fried liquid.  Otherwise, you’re not really doing anything more revolutionary than deep fried Twinkies at the state fair.

Like stunt car driving, when it’s done amazingly well, molecular gastronomy is an art involving more than one sense – and Wylie Dufresne does it very well.  Don’t take my word for it – read the WD-50 review by the New York Times.  That place is one of only two restaurants on my bucket list – the other being Paula Deen’s restaurant in Savannah, Georgia.  Hard-core readers will recall that I blogged about visiting The Lady and Sons a couple years ago during a road trip, and this is pretty much a polar opposite experience.

The key word shared between WD-50, The Lady and Sons, and Ken Block’s driving videos is experience, and I’m not talking about the number of years you’ve been punching the clock.

What’s Your User Experience Like?

When someone steps into your cubicle to work with you on a problem, are they scared?  Intimidated?  Pissed off?  Most of us database administrators have ugly, nasty reputations for always saying no and never explaining why.  Think about what that’s like for your customers – and yes, even if people aren’t paying you directly, they’re your customers.

I’ve never given Ken Block a dime, but in a way, I’m his customer, and he’s gone way out of his way to build a killer experience for me.  He’s building a brand that he can sell to advertisers like DC Shoes.  Web sites work the same way, too; in today’s Coding Horror blog entry, Jeff Atwood talks about the business of building a successful web site:

“Despite Benjamin’s well reasoned protests, the source code to Stack Overflow is, in fact, actually, kind of … well, trivial. Although there is starting to be quite a lot of it, as we’ve been beating on this stuff for almost a year now. That doesn’t mean our source code is good, by any means; as usual, we make crappy software, with bugs. But every day, our tiny little three person team of speedy-but-doomed Velociraptors starts out with the same goal. Not to write the best Stack Overflow code possible, but to create the best Stack Overflow experience possible. That’s our mission: make Stack Overflow better, in some small way, than it was the day before. We don’t always succeed, but we try very, very hard not to suck — and more importantly, we keep plugging away at it, day after day.”

Users aren’t giving any money directly to StackOverflow, but Jeff knows he has to build a killer end user experience because that experience pays off in other ways.  Your career has the same goals.  Even though the developers, project managers and end users may not pay your salary, they do have political capital with your boss.  They can make or break your career in an instant.

After years of working with people who want to throw triggers everywhere, people who don’t understand the basics of indexes, people who want their server to run 24/7 for zero cost, and people who call you every weekend for trivial support issues, it’s easy to become cynical and angry.  It’s easy to let yourself slip into growling when you pick up the phone.  Heck, I have to refocus on this all the time – I get frustrated too, despite the shiny-happy-upbeat-please-your-customers stuff I post on the blog.  Building a good end user experience is a never-ending journey.

To be the best at what you do, it’s not enough to just do what you do. Lots of people toil away just like you every day cranking out widgets. The difference is making people want to go out of their way in order to work with you and to watch you work.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Are You Being Treated Fairly?

Chris Shaw posted a question on his blog and tagged me:

Do you feel like you are being treated fairly at your current or past employers? The question stems from the fact that very few people today stay at a company 20 to 30 years like they did when I was growing up. Do you feel like the company feels a loyalty toward the employee or do you think that they look at you just as head count? No reason to get yourself in trouble, so you can refer back to past employers.

I’m glad you asked.  I’m being treated like garbage and I hate these bozos who pay my salary.

Oh, wait, is this microphone on?

Alright, seriously, time for a rant.  Sorry, Chris, but you pushed one of my hot buttons here.

The Life of a Hotel Housekeeper

Did you know that many housekeepers make below minimum wage? They often make $3/hour because they’re considered to be tipped employees.

Hotels have to clean occupied rooms every day whether the guest is checking out or not.  Sometimes they get lucky: the guest might be exceptionally considerate, use only one trash can, use only one bed, and not leave Cheetos crumbs all over the nightstand.  Sometimes, they’re not so lucky, and they get a room where a family with kids has done what a family with kids does on vacation: leave stuff everywhere.  Overall, housekeepers average around two rooms per hour, or about 15 rooms during an 8-hour shift.  The numbers vary depending on whether it’s a corporate hotel (businesspeople are pretty clean) or a vacation hotel (families are filthy.)

A $3/hour housekeeper who cleans two rooms per hour needs to get $1 tip per room just to make it up to minimum wage.

Sadly, many hotel guests don’t leave tips.  And the ones who do, often leave tips only on the day they check out, thinking that that’s the only day the maid really works.  Not so much – my 2 rooms/hour number includes stayovers.  Next time you stay in a hotel, tip the maid $2 minimum every single day, and start noticing how much she does. I’m super-anal about reducing their workload: I only use one trash can, I clean the coffee pot myself after I use it, and I try not to use the glassware when I just want a sip of water before bed.

Why I Know About Housekeeping

I got my start in the hospitality industry working in hotels and restaurants, and I worked my way up from front desk clerk to managing hotels.  No matter how high up you go at a 100-200 room hotel, there’s still going to be days when you have to make beds or clean toilets or cook omelettes because somebody didn’t show up.  You’re relying on a pyramid of people, and a great deal of them make near minimum wage or below.  Dozens of them have to show up every day in order for your business to run successfully, but you can probably understand why some of them will choose not to make that commute into work in the morning, or why they’d want to work their way up to a better job (and out of your hotel) as fast as possible.

Succeeding in the hospitality business means a never-ending cycle of training replacement staff.  When a new hotel opened up, they’d offer $.10-$.25 more per hour in order to lure experienced housekeepers or laundresses over.  For a $3/hour employee, that’s a big incentive, and they’ll take that offer.  Hotel managers are handcuffed by budgets, and they can’t simply give everybody raises every time a new hotel comes into town.  Managers try to keep employees happy, build a positive work environment that people will enjoy, but it’s tough, and sooner or later every employee is going to leave.

Employees Are Replaceable

I can almost hear the protest comments rolling in now.  “But you have to train people and promote from within,” they’ll say.  “You have to make sure there’s opportunities for everybody as they grow!”

That’s naive.  If you’re running a kitchen, somebody’s gotta wash the dishes, and nobody wants to be a career-long dishwasher.  You can’t have an entire kitchen made up of head chefs, and furthermore, when somebody makes it to head chef, they aren’t itching to leave.  You can’t expand your restaurant to more locations simply because you’ve got a few good chefs – there has to be a market demand for your food, ample room for expansion, and a lack of competition.

Business owners and managers have a tough job: they have to make employees feel welcome and needed, yet at the same time make sure that every employee can be replaced.  An irreplaceable employee is a business risk.

I know I’m completely replaceable.  If I quit Quest tomorrow, there’d be a line of people begging for my job, and there’s a bunch of people who could do it just as well or much better than I’m doing it.  Heck, I’ve even pointed a couple out to my managers and said, “This is the next person who should have my job, and they’d be great at it.”

So how do I sleep at night?

Companies Are Replaceable Too

Both parties in the negotiation process have to benefit in order for the deal to work.  Your job has to be a win for the company, and it has to be a win for you.  It sounds so BS-life-coach-y, but it’s true: it’s gotta be a win/win scenario.

If you’re the only one winning, the company will let you go. If you’re making too much money, if you’re not putting in enough hours, if you’re not delivering the results they want, they are gonna drop you like a temp table.

If the company is the only one winning, you need to let go of them. Nobody else is going to do it for you.  Nobody else is looking out for your career.  (If you think headhunters are looking out for you, think again – they’re paid by the company, not by you.)

Sounds inconceivable in this economy, but there are always jobs for the right people.  Even since the stock crash started, I’ve been contacted by companies who are hiring top notch DBAs, and they’re not paying housekeeper wages either.  I’ve passed that info on to my friends who are looking for work, and I know two great database guys who might make great career moves in the next couple of weeks due to info I’ve passed along.

If you don’t believe me, and if your experience indicates that you can’t get another job right now, then stop to think about that phrase again for a second, and look at it closely.  Other people are getting better jobs right now, as we speak.  Maybe – just maybe – the problem is you, and you need to re-evaluate the way you think about careers.

It’s Not Just About Your Skills

Talent Is Never Enough

I'm Talking To You, @ReaderName

Every time I write something like this, I get a chorus of private emails saying:

“You don’t realize how bad the market in @MyCityName sucks.  Nobody’s ever hiring @MyCareerName, and I’m a rock star genius mad scientist with amazing talent.  You’re a jerkwad who doesn’t know @MyFavoriteExpletive.”

You’re partially right: I am a jerkwad, and you probably have amazing talent.  But like the book says, Talent is Never Enough.

Your manager reads books to figure out how to get more out of you: maybe you should be reading books to figure out how to get more out of your managers too.

I won’t deny it: the first few times I picked up books like this years ago, I thought they were flakey inspirational crap.  But my career has changed when I started applying geek techniques: I stopped trying to overclock my desktop’s CPU, and started focusing on overclocking my career.

So before you blog about how your company doesn’t respect you, doesn’t love you deeply and truly, doesn’t take you for long walks on moonlit beaches and never wants to let you go, stop to think about whether you feel the same about your company.  I like the company I work for, but only because we’ve come to agreements that are win/win for both of us.  When it’s not – either when I stop delivering for them, or they stop delivering for me – I expect us to both start making plans to replace the other.

Who I’m Tagging

Got scared there, didn’t you?  Thought I was going to tag you by name and make you tap dance around this question.  No, I’ll refrain from tagging anybody on this particular meme.  When I first read my name on Chris’s blog about this, my first reaction was, “There’s no way in hell I’m answering that one,” so I don’t want to put anybody else on the spot.  If you’d like to answer it on your blog, go right ahead though!

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Communication Breakdown

Here’s how I see the forms of communication and what they say about who’s sending the message:

Twitter or forum message to the public: “I need help, and I’ll take it from anybody who’s available, inside or outside of my company.”

Email: “I need you specifically, but it’s not urgent.”

Instant Message: “I need you specifically, and whatever you’re doing on your computer right now is less important than what I need.”

Phone Call: “I need you specifically, and whatever you’re doing on your computer or in your office right now is less important than what I need.”

Before you send an IM or make a phone call, stop to consider the person on the other end.

Is what you’re asking for really a higher priority than whatever they’ve got open on the computer and who’s standing in front of them?

If not, be a nice guy: send an email, or even better, ask more people at once so that someone with free time can respond faster.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts