Tag Archive: virtualization

Top 10 Keys to Deploying SQL Server on VMware

The most successful deployments of virtual SQL Servers have a few things in common.  When a company is doing all of these things, odds are they’re going to be very happy with their virtual SQL Servers:

10. Use vSphere 4.1, not earlier versions. vSphere 4.1 introduced major improvements in multi-CPU scheduling that vastly improve performance.  SQL Server will break queries out across multiple virtual CPUs, and it expects all of those vCPUs to perform identically.  vSphere 4.1 helps make that happen.  You can read more about the vSphere CPU scheduler here.

Lacie IAmAKey Drive9. When using blades, avoid overcommitting switch uplinks. Virtualization works great with blades – but only when the SAN and network teams monitor utilization rates between the blade chassis switches and the rest of the networks.  All too frequently, the SQL Server is thrown into a blade chassis with dozens of other servers all competing for the same small amount of storage and network bandwidth leaving the blade chassis.  Everyone looks at their monitoring systems and can’t understand why the backups, big queries, and maintenance jobs run so slow, and the culprit is the hidden small uplink.

8. Avoid 1Gb iSCSI for storage. While this cheap and easy-to-use storage works great for most servers, it doesn’t work as well for SQL Server.  If you’re happy with the speed of SQL Server running on local storage, you can be in for a rude surprise with 1Gb iSCSI.

7. Test storage performance before deployment. I’m partial to SQLIO, which might be the worst-named tool in history.  It has absolutely nothing to do with SQL Server – it doesn’t require SQL Server, and it doesn’t mimic SQL Server.  It just flat out hammers IO using whatever parameters you pass in.  Using a test file of the same size as the expected database, the storage should consistently exceed 100MB/sec whether it’s random or sequential, reads or writes.  Higher numbers than that may be required due to the application design or end user expectations, but that’s a good foot-in-the-door number.

6. Compensate for slow storage with memory. If you can’t get the storage performance you need, you can help by caching as much of the database as possible in memory.  If the projected database size is 50GB but the virtual server only has 16GB of memory, then it’s not going to be able to cache the entire database.  Perhaps the users won’t be querying old data, in which case you might be able to get by with less.

5. Ensure CPU power saving is turned off. While Intel’s latest Xeon processors provide impressive power savings, they won’t ramp up to full processor speed unless the CPU is under heavy load.  SQL Server will rarely push the processors that hard, which means they stay slow – sounds good in theory, but in reality, every query takes 70-100% longer than it did pre-virtualization.  If you care about query performance, turn this setting off in the hardware BIOS.  You can read more about the power-saving CPU issue here.

4. Coordinate VMware reservations and shares with SQL Server settings. VMware vSphere has a great set of options to ensure that a guest OS gets the right amount of resources for its needs.  These settings need to be set in concert with SQL Server’s min and max memory settings.  There’s plenty of bad advice out on the web saying things like, “Just disable the balloon driver and give SQL Server all the memory” – that’s not right either.  There’s a happy medium in letting SQL Server and VMware cooperate to balance resources across multiple guests, but it only works when these settings are aware of each other.

3. Use Resource Pools to track SQL Server licensing. Microsoft’s virtualization licensing for SQL Server is notoriously complex.  Starting with SQL Server 2008R2, only Datacenter Edition ($60k/cpu socket) provides unlimited virtualization rights.  Enterprise Edition ($30k/cpu socket) provides just four VMs.  Tracking these closely with VMware Resource Pools can result in huge cost savings.  If SQL Servers are allowed to move to any host in the VMware cluster, then a licensing audit can produce staggering costs.

2. Use VMware HA for high availability. If your users can tolerate a SQL Server outage of 2-3 minutes, VMware HA is much easier to manage than a SQL Server cluster.  If your users require less than 30 seconds of downtime, consider implementing a physical SQL Server cluster instead.  SQL Server clusters are tricky enough to manage on their own, and doing them inside VMware adds an impractical level of management on servers that can’t be down for more than 30 seconds.

1. Virtualize small SQL Servers first. Start by gaining experience with 1-2 vCPU servers with under 16GB of memory.  As the company’s sysadmins grow accustomed to how SQL Server uses CPU and memory in a virtual environment, they’ll be more confident virtualizing larger servers.  If the DBAs and sysadmins don’t get along when trying to pin down performance problems on smaller servers, they’re going to be very adversarial when dealing with larger servers.

Wow – That’s a Demanding List!

I know what you’re thinking: “This outside consultant is greedy and expects everybody to dump tons of money into their SQL Servers.  He’s asking for the moon.  Nobody does this in real life.”

Let’s rewind back to the beginning of the recommendations where I said, “When a company is doing all of these things, odds are they’re going to be very happy with their virtual SQL Servers.” You can certainly skimp on some of these items and still stand a pretty good chance of being happy with your SQL Server performance.

The more items you skimp on, the worse your chances become.  If you implement a virtual SQL Server with 32GB of memory trying to cache 250GB of databases on RAID 5 storage, hooked up via 1GB iSCSI, with no prior experience virtualizing SQL Servers of that size, odds are you’re going to be miserable.  Users will scream and complain, and you’ll bring in an outsider who will track the problems back to these types of recommendations.  Keep my contact info handy.

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

Register for SQLBits in England – Space Running Out!

If you deal with VMware, Hyper-V, SANs, and SQL Server, come check out my pre-conference session at SQLBits in York, England on Thursday, September 30th.  My all-day session is called, “Virtualization, SAN, and SQL Server: The Perfect Storm.”

This will be a fun, intimate session – it’s limited to 40 people max, and we’ve got a few spots left.  Here’s the abstract:

Virtualization, SAN, and SQL Server: The Perfect Storm

Each of these things alone is tough enough to manage, but when you start to combine them, the forecast calls for rogue waves of bad performance.  Metrics like CPU % and disk queue length just don’t mean anything anymore.  No matter what numbers you hand your virtualization sysadmins, Windows admins, or SAN admins, they all say the same thing: “It’s a SQL Server problem.”

Learn how to fight back as Brent Ozar, Microsoft Certified Master, exposes some surprising truths like:

  • What metrics can prove it’s not a SQL Server problem
  • Why you might not want to separate your data and log files onto different drives
  • How to double-check to make sure the other guys are doing their job
  • The crucial configuration choices that can doom your SQL Server performance from the start

By the end of this session, you’ll be able to walk back into your office, gather statistics and configurations, and give your sysadmins and SAN admins the information they need to fix performance problems on their end.

For £450, you get my all-day pre-con session on Thursday plus full days of training on Friday and Saturday too!  Check out the SQLBits agenda, which includes sessions like:

  • Understanding SARGability – Rob Farley is one of the funniest guys you’ll ever meet, and his sessions get rave reviews.  Once you understand SARGability, you’re much more equipped to troubleshoot slow queries.
  • SQLDiag and SQLNexus – these two completely free tools will change the way you do performance tuning.  Microsoft Certified Master Christian Bolton, the lead author of Professional SQL Server 2008 Internals and Troubleshooting, will explain how to use ‘em.  His company, Coeo, is even giving away a free Fusion-IO drive during SQLBits!
  • Introduction to Extended Events – this new tool in SQL Server 2008 doesn’t get much press because it’s a pain in the rear to get started with.  Jonathan Kehayias is the man to show you how because he wrote the free SSMS Extended Events Manager, a tool that’s been featured in SQL Server Magazine.

This event has speakers from around the world including Brad McGehee, Buck Woody, Kevin Kline, Thomas Kejser, and more.  This is the cheapest way to see the best people in one place in Europe, and it’s in a fun, relaxed atmosphere where you can have plenty of discussions with the speakers.  To see what the shorter sessions look like, check out one of my sessions from my last SQLBits:

Register now and choose Full Conference, and you can pick my session as your pre-con.  Register fast – we’re running out of seats!

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

My Weekly Bookmarks for October 23rd

Here’s my bookmarked links for October 17th through October 23rd:

SQL Server Links

PASS Links

Tech Links

The Junk Drawer

These bookmarks are automatically imported from my bookmarks at Delicious.com. If you’d like to get up-to-the-minute updates on what I’m bookmarking, you can subscribe to my bookmark RSS feed.

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

My Weekly Bookmarks for October 9th

Here’s my bookmarked links for October 2nd through October 9th:

SQL Server Links

Tech Links

The Junk Drawer

  • I Love That Game – Brilliant criminal minds at work.
  • Twitter Data Analysis: An Investor’s Perspective – A bunch of oddball stats about Twitter users and their histories.
  • Will Work for Whuffie? – Why you have to charge fees for speaking engagements when you hit a certain level of fame. (No, I’m not there yet, hahaha, but even if I was, my speaking engagements are free because I’m a service of Quest Software. No, not that kind of “service,” buddy.)

These bookmarks are automatically imported from my bookmarks at Delicious.com. If you’d like to get up-to-the-minute updates on what I’m bookmarking, you can subscribe to my bookmark RSS feed.

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

My Weekly Bookmarks for October 2nd

Here’s my bookmarked links for September 25th through October 2nd:

SQL Server, Cloud, and Tech Links

Writing, Blogging and Networking Links

The Junk Drawer

These bookmarks are automatically imported from my bookmarks at Delicious.com. If you’d like to get up-to-the-minute updates on what I’m bookmarking, you can subscribe to my bookmark RSS feed.

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

Bookmarks for September 25th

These are my recent favorite links:

Unfortunately, there’s more, but the WordPress plugin I’m using will only import 15 bookmarks per hour. Grumble. To see the full list of what I’ve been reading lately, either check out my Delicious bookmarks or subscribe to my Google Reader feed.

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

My Weekly Bookmarks for September 14th

Good news and bad news – the good news is that everybody’s been going wild and crazy for the SQLServerPedia PASS contest.  The bad news is that editing the articles & setting up the bloggers has eaten up every moment of my spare time, hahaha.  As a result, I had to do the unthinkable this weekend: scan through Google Reader and then hit mark-all-as-read.  Here were the survivors, and I’m sure I missed some good stuff:

These bookmarks are automatically imported from my bookmarks at Delicious.com. If you’d like to get up-to-the-minute updates on what I’m bookmarking, you can subscribe to my bookmark RSS feed.

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

Laptop Virtualization Best Practices – And a Contest!

Whether you’re using Windows or a Mac, if you’re thinking about using virtualization for the first time on your laptop to test out new operating systems like Windows 7 or Windows 2008 R2, there’s a few things you should know.

Get Another Hard Drive

Drive Bay

Drive Bay

Laptop drives aren’t quick to begin with, and running two operating systems simultaneously doesn’t make life any easier for your pokey drive.

Your laptop probably has a removable CD/DVD drive, and that drive bay slot is designed to hold more than just optical drives.  You can pick up a hard drive caddy that slides into that same slot.  Check your laptop’s hardware manual for the exact part number, and then search Ebay for that part number.  Drive bay caddies are usually available for around $20-$40.

Apple Macbook users can swap out their internal drives with the MCE OptiBay drive adapter too.  This voids the daylights out of your warranty, but it’s not as hard as it looks.  I just went through this process with my own Macbook Pro, and I recommend it highly – I have a review of that coming soon.

Pay close attention to the caddy bay specs, and then order a hard drive to match.  Most laptop bay caddies take either a PATA or SATA 2.5″ laptop drive.  Some high-capacity 2.5″ hard drives are a non-standard 12.5mm high instead of 9mm, so make sure you don’t get a drive that’s too thick to fit inside your caddy.  Buy the fastest (not the largest) drive you can afford.  I use the 2.5″ performance test charts at TomsHardware for reference, and the current king-of-the-hill on performance per watt is the Seagate Momentus 5400.6 for around $90.

USB Piggyback Drive

USB Piggyback Drive

If your laptop doesn’t have a drive bay adapter or if you’re not willing to give up that trusty CD/DVD drive, you can also use an external USB hard drive.  Just make sure to get one of the 2.5″ models that doesn’t require external power – the less cables you have to carry, the better.  Then mount it on the back of your laptop display using Velcro tape.  Presto, you can detach it and reattach it whenever you need to pack the laptop into a tight case.

After installation, Windows will see this as just another hard drive that you can partition and format.  When you build virtual machines, store them on this secondary hard drive.  Bonus points for backing up your important files there, too.

Get As Much Memory As Possible

The more memory you have, the better.  I’d consider 4gb the minimum to comfortably run two Windows OS’s simultaneously no matter what virtualization software you’re using.

To find out how much memory your laptop can handle, use the memory configuration tool at Crucial.com.

When It Comes to Virtual CPUs, Less Is More

When building your guest OS’s, always set them up with just one CPU.  Virtualization CPU scheduling has a gotcha: if your virtual OS is set up with two CPUs, then the hypervisor’s scheduler will wait until two cores are available before doing any work in the guest – even if the guest only needs to do one core’s worth of work.  This same concept holds true at the server-level too – don’t set up your ESX guests with 4 CPUs just because you can.

Understand Virtual Networking Modes

The various flavors of hypervisors have three basic network modes for guests:

  • Bridged Networking – aka Home Office Mode. This is the one you’re going to think you want, because each virtual machine gets its own TCP/IP address directly from your home router just like your host machine does.
  • Network Address Translation – aka Starbucks Mode. The hypervisor acts as a little router, and it assigns unique TCP/IP addresses to each guest.  The guests aren’t on the public network directly, but they can access network resources just fine.  This is my favorite because I can switch back and forth between different networks without the guest servers wigging out.  I can suspend them to disk at home, then wake them up at Starbucks and nothing changes.  I highly recommend this mode, especially since it’s easy to switch back and forth between this and…
  • Host-Only Networking – aka Tin Foil Hat Mode. Like Starbucks Mode, each guest gets its own internal TCP/IP address on your laptop’s private network, but there’s no communication with the outside.  This is good for testing software that might have conflicts with other stuff on your network, and it’s also good when you’re on a slow network.  When I’m using my aircard and I don’t have a good signal, I’ll boot up my guests in Host-Only mode so that they don’t try to connect to Microsoft to download updates or anything else that might suck up my precious bandwidth.

Back Up Your Virtual Hard Drives

Installing the Windows guest, configuring it the way you want it, and patching it takes hours.  After you’re done – but before you install any third party software – shut it down and copy the flat files to another directory.

When you want to spin up a new virtual server, just make another copy of those flat files and import them into your hypervisor.  The methods are slightly different depending on what virtualization software you’re using, but all of them are much easier than reinstalling Windows from scratch and patching it.

That’s it for my tips – if you’ve got more to share, feel free to leave ‘em in the comments for other folks to get started easier.

Hard Drives, Get Your Hard Drives Here

Hard Drives, Get Your Hard Drives Here

Oh, And the Contest! Want a Free 120GB 2.5″ USB Drive?

I’m moving to Chicago soon, and I need your help.  I need to clean out my home office, but I hate throwing gadgets away.  Time to give away some of my extra goodies.

Today, since we’re talkin’ USB drives, let’s give those away.  I’ve got two self-powered USB 2.5″ hard drives, both 120 gigs, both exceedingly stylish.  One is a speaker’s gift from the PASS Summit last year, and one is a leather-bound hard drive.  (I have very strange tastes in USB devices.)

To win, just leave a comment here.  Only one comment per person, please.  I’ll draw two comments at random on Saturday Sept 12th at 7AM EST and announce ‘em here.  Good luck!

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

My Weekly Bookmarks for August 28th

Here’s my bookmarked links for August 23rd through August 28th.  I’m using an automatic plugin to build this list, and I can see that this probably isn’t going to work – I just found way too many things interesting in one week, and it doesn’t break stuff out into categories.  Blogger fail.  Here it is anyway as an example of What Not To Do during my Better Blog Week:

These bookmarks are automatically imported from my bookmarks at Delicious.com. If you’d like to get up-to-the-minute updates on what I’m bookmarking, you can subscribe to my bookmark RSS feed.

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

Blogs About Virtualization for DBAs

It’s hard for DBAs to find good virtualization information.

We end up reading brochures and whitepapers trying to figure out the best way to virtualize our database servers.  We don’t have the time to sift through the entire blogosphere to figure out what’s relevant for DBAs.

pass_logoAt the Virtualization Virtual Chapter of the Professional Association for SQL Server (PASS), we’re working to change that, and we’ve got some fantastic people helping.  These are some of the top bloggers in the virtualization world today:

These guys blog about virtualization in general, and their material can get pretty technical. I love reading about how Cisco’s new blade system works, for example, but I know most of you don’t have the time to sift through that much information.  That’s why I contacted these guys and asked if they’d be willing to syndicate their beginner-level virtualization stuff and their DBA-related posts in one place.

Starting today, you can get the latest DBA-focused virtualization news, tips and tricks in whatever way works best for you:

One more thing – I know this first group of bloggers (including me and Jorge Segarra) is pretty VMware-focused, but I couldn’t find any Hyper-V blogs outside of the official Microsoft one!  If you know of one, or if you’ve got a favorite virtualization blog, let me know.  We’re open to syndicating any high-quality virtualization blog that will help the DBA community.

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