Scott Hanselman

VM Performance Checklist - Before you Complain that your Virtual Machine is Slow

May 29, '07 Comments [22] Posted in Tools
Sponsored By

I continue to meet folks who complain that their Virtual Machine performance is slow. Yes, it would be great if VMs somehow were able to self-tune the relationship between themselves and the host OS, but that's sadly not the case.

When you're running an OS within and OS and maintaining a FileSystem within a FileSystem, not to mention sharing a hard drive spindle, there's lots of opportunities for things to go very slowly.

If you're experiencing poor VM performance, I would encourage you to go through a Performance Checklist.

Also, before you start, remember what you goals are. You'll not get your VMs running at 100% of native speed, at least not this year, so just stop aiming for that as a goal.

Here's some more realistic goals:

  • Ideally Virtual PC performance is at:
    • CPU: 96-97% of host
    • Network: 70-90% of host
    • Disk: 40-70% of host

Try to make all of these changes if you can. If you can't do one or more of these recommendations, then you can't complain. ;)

Virtual PC Performance Checklist

  • Make sure your Host Operating System's disk is defragmented.
    • This includes the System Disk (the disk your OS boots off of) as well as the Disk that holds your Virtual Hard Disk File.
      • For a quick fix, use a single-file defragmenter like Contig from SysInternals. With the Virtual Machine shut down, run Contig -a to analyze single file fragmentation and run without -a to defragment the file.
  • Run Fewer Applications.
    • I'm continually amazed when folks complain about VM performance and when I get to their desk I see that they are running Outlook. That 200+megs could be better used by the system. Are you running a VM or checking your email? Consider checking your email on a schedule, or using Outlook Web Access while you work on your VM.
    • If you have 2 GIG or more of memory, consider running your Host Operating System without a Paging File. This doesn't mean you get to keep 50 applications, plus Outlook running all at once, but it does take the pressure off your Host OS's disk, and you might find things run considerably snappier.
  • Run the Virtual Machine on a separate spindle.
    • There's no better tip, as anyone who has run VMs (I've been using VMWare since it was in Beta) will tell you. The #1 bottleneck is disk.
      • Try to use a 7200RPM or 10000RPM drive for your VM disk
      • Use USB2 or SATA or Fireware.
        • If you're using USB2, make sure the Eternal Hard Drive is on it's own USB root hub, all alone. Don't share it with your keyboard, mouse, or webcam.
  • Optimize your VM for your current task.
    • Personally, I use and highly recommend Invirtus Virtual Machine Optimizer for this. It's inexpensive if you value your time. Considering getting a site license and actually do the math at how much time it'll save your company when you're trying to convince your boss. I run it over lunch on a VM and move on. You can also do a lot of the work manually if you have the time using tools like XPLite and CrapCleaner (although less so with CrapCleaner if the box is already fresh).
      • Remove any application that's not needed.
      • Shut down every service you can possibly get away with.
  • Enable Hardware Assisted Virtualization
    • If you've got this on your computer, turn it on. There IS some concern about really sophisticated Trojans that can use this technology for evil, but for me, it's all good as it speeds most Guest Operating Systems (especially non-Microsoft ones) up quite a bit.
  • Give your Virtual Machines LESS MEMORY
    • I've found that 512 megs is just about the Ideal Amount of memory for 90% of your Virtual Machines. Don't bother trying to give them 1024 megs, it's just not worth the pressure it'll put on the Host Operating System.
  • Considering making a custom Windows install for your VMs.
    • Rather than going to all the effort to REMOVE things, why not create a Windows installation that can be shared across your organization that doesn't include the crap ahead of time. There's a Windows Installation Customizer called nLite that lets you prepare Windows installations so they never include the stuff you don't want. Makes it easier if Solitaire is never installed, eh?
  • Make sure the Guest Operating System is defragmented.
    • Jeff likes this free Disk Defragmenter that runs in that "Text Mode" place before Windows really starts up. This allows it to get at files that don't always get defragmented.
  • Squish your VM Hard Drive.
    • Again, I use Invirtus so it does this for me, but you can also zero out the free space on your VM hard drive with the Virtual PC Pre-Compactor that comes with Virtual PC when hosting Windows, and there are Linux options for shrinking VM hard drives as well.
  • Don't use NTFS Compression on the Virtual Machine Hard Drive File in the Host Operating System
  • Don't Remote Desktop or VNC into Host Operating Systems that are hosting Virtual Machines.
    • If you're remoting into a machine where THAT machine is running a VM, note that to the Remote Desktop protocol (and VNC) the VM just looks like a big square bitmap that is constantly changing. That guarantees you slow performance. If you can, instead, Remote Desktop into the Virtual Machine itself.
  • Make sure you've install the Virtual Machine Additions (or Tools, or Utilities, or Whatever)
    • Virtual PC and VMWare and Parallels all include drivers and tools that improve the performance of your Virtual Machine. They are there for good reason, make sure you've installed them.
      • Also, if you're running a Virtual Machine created under and older version, like Virtual PC 2004, and you're now running under a newer one, like 2007, pay attention to the upgrade warnings and install the latest drivers and Virtual Machine Additions.
  • Optimize Painting and the "Perception of Responsiveness"
    • If you're running a VM, you don't need to have eye candy like menu fades, smooth scrolling or shadows.
      • Turn off wallpaper
      • Turn off Window Dragging and Shadows under Menus (under Effects in the Display Control Panel). Consider removing all effects like fading as well as ClearType.
      • Consider running the Classic Theme if you're running an XP VM, or consider "net stop themes" altogether.
      • Turn off the Mouse Pointer Shadow in the Mouse Control Panel.
      • Turn off Mouse
      • Use TweakXP or change the Registry to remove the Menu Delay for the Start Menu and other Menus via the MenuShowDelay setting in HKEY_CURRENT_USER\Control Panel\Desktop.

Did I miss any tips?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

MSMPENG.EXE, TrustedInstaller.exe, SearchIndexer and SLSVC.EXE at 100% CPU on my Vista Machines

May 29, '07 Comments [44] Posted in Musings | Tools
Sponsored By

UPDATE: Looks like this bug has been fixed in Vista Service Pack 1 (SP1). I've upgraded and I've not seen this issue again.

I give Microsoft a lot of credit for the work all their bloggers do to increase the transparency of their business. Specifically the developers and folks in the developer division (devdiv) do a great job of letting us know what's up, especially when things are wrong.

However, when I have a problem, and I Google and Google...

(and sometimes find myself - that's always disheartening when you Google for a problem, find yourself, then at that moment realize that not only have you had this problem before, but you're still screwed.)

and find a huge number of folks "suffering" on blogs, on Usenet, in Forums with some similar problem, and nary a Microsoft blogger or MVP in sight.

Try Googling for any subset of these words "MSMPENG.EXE, TrustedInstaller.exe and SLSVC.EXE at 100% CPU on Vista Machines" and you'll discover a mass of pained and screaming Vista users, yearning for a HotFix.

When I see things like this, I think "If I worked for Microsoft, fixing this problem could be a HUGE opportunity." This isn't a small problem, if Google has anything to say about it, but rather something is really sick somewhere.

I've had a pretty decent Vista experience, recognizing that I'm an Early Adopter. Early Betas hurt me, and an RC1 or two destroyed a machine or two, but after release (RTM) including installation and day to day use, my experience has been nice. My wife, my mom, and myself all run Vista. I also got OneCare for the whole family, having had nice experiences as a Beta Tester.

Now, in the last month, on EVERY Vista Machine I have, from a slow AMD K5 my wife runs, to a Toshiba m200 Tablet, an IBM T60, and a home-built monster, has suffered with these issues. All of them, every machine and every issue:

  • MSMPENG.EXE - Some say this is Windows Defender, others say it's the OneCare AntiVirus. SysInternals ProcMon says it's constantly going over totally innocuous files over and over again. Note that I've turned off both OneCare and Defender on these machines. (Not sure why there's two apps?) This process just won't stop sucking the life from my machines. Things are SO slow, especially when the process hits a 4 gig ISO or 12 gig VM Disk Image.
  • TrustedInstaller.exe - This application has such a suspicious name I immediately started Googling around thinking I was infected with some evil Trojan. I mean, "TrustedInstaller.exe"? Seriously, like I'm going to see this in Taskman and say to myself, "oh, as long as it's TRUSTED." This process starts up seemingly randomly, even when I'm not installing things. It runs for 10 minutes or so, then disappears. I fear it. I fear iTunes on Vista more, but this one is pretty bad also.
  • SLSVC.EXE - The Software Licensing Service. I guess it licenses software, or hands out licenses, but there's no telling when it'll pop up, churn for an hour, then leave.
  • SearchIndexer.exe and friends - These guys just won't stop. There's usually 3 or 4 of them going all at once, but I still have to wait for a count of one-one-thousand, two-one-thousand, three-one-thousand, four-one-thousand before Search Results come back.

I don't like having to run my Operating System with Taskman constantly open because I no longer trust background processes. I'd like someone at Microsoft who works on one of these apps, help me understand what crazy edge case I've hit on every machine I own and how I can make it stop. I mean this not as a troll, and if you read my blog, you know I never blog bile, but I'm really interested in figuring out what's up.

What process is currently sucking up YOUR CPU? (Mac and Linux folks are welcome to join in, as I run TOP in a Terminal constantly on my Macs also.)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 65 - Martin Fowler and David Heinemeier Hansson

May 24, '07 Comments [35] Posted in Podcast | Programming | Ruby
Sponsored By

My sixty-fifth podcast is up, recorded on the floor RailsConf2007 here in Portland, Oregon. In this episode I sit down with Martin Fowler of Thoughtworks and David Heinemeier Hansson of 37signals and talk about beauty, making developers happy, the death (or life) of HTML, the future of Microsoft, and I ask if we should care about Rich Internet Applications. DHH is the creator of the Ruby on Rails framework, and Martin Fowler is the Chief Scientist at ThoughtWorks, well-known systems architect and Extreme Programming expert.

This episode is chock full of goodness and good guests, so it's double the ordinary length, clocking in at over 40 minutes, so forgive me, as all three of us tried not to waste the listener's time.

If you have trouble downloading, or your download is slow, do try the torrent with µtorrent or another BitTorrent Downloader.

Links from the Show

Martin Fowler's Bliki (p5p)
RailsConf 2007 • May 17, 2007 - May 20, 2007 • Portland, Oregon (p5r)
Ruby on Rails (p5t)
Loud Thinking by David Heinemeier Hansson (p5q)
Jesse James Garrett's Information architecture resources (p5s)
Tree Surgeon for .NET (p5u)

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The TechEd Party to Attend - Party with Palermo

May 24, '07 Comments [17] Posted in TechEd
Sponsored By

If you are headed to TechEd 2007 in Orlando, make sure you make the time to go to Party with Palermo. Jeff throws an unmatched geek party and you don't want to miss it.

It's free, and I can attest, it's great. You'll meet lots of cool folks, many bloggers, wonks and other geeks. I went to the last one in Seattle and had a blast.

Sadly this year, a very large combination of events, both business and personal, meant that I have had to bow out of TechEd, so I won't be there to join you. It's only the second time ever I've canceled a speaking gig, and I'm bummed, but it was the right thing to do at this point.

But for you who are going, go over to the Party with Palermo Website and RSVP by leaving a comment right now!

It's June 3rd, 2007 @ 7PM - 11PM at Glo Lounge:
8967 International Dr, Orlando, FL
(407) 351-0361

Enjoy. My giant head may appear via Skype Video Conferencing at some point during the evening. ;)

Jeff's also been kind enough to add Team Hanselman and our Diabetes Walk 2007 as honorary community sponsors of the event, so drink lots of beer and click for a Tax-Deductible Donation.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Reading Documents on your Screen Effectively

May 24, '07 Comments [15] Posted in Musings
Sponsored By

I was at Fresh Thyme Soup earlier this week (fantastic place, seriously, go there, it's all made from scratch) and there was a guy surfing with their free wireless whose desktop looked basically like this (this is mine, for illustration.) He was actually running Ubuntu and running what looked like AbiWord, but that's not the point.

Why is a guy who's _______ (insert adjective here...perhaps "savvy?") enough to run Ubuntu reading a document with the window sized like this?

Seems like I'm forever doing this series of keystrokes in Word: Alt-V, then Z, then T, then Enter, to return Word to the Text Width Zoom level. Then I use Alt-V, then U, for Full Screen mode, especially when I'm forced to present a Word document via projector.

Is this the fundamental issue with a Windowing interface that lets you size things willy-nilly.

I've been using a MacBook Pro for two weeks now and I'm still, even now, never sure what I'm going to get when I press the little Green dot that I think of as "Maximize." Sometimes a window gets really tall, other times really wide. With the Finder, it's a roll of the dice.

Same thing with Windows, and Ubuntu. I'm FOREVER forced to rearrange things. There's got to be a middle place between Full-Screen/Maximized and Minimized that "knows" what I need. The fact that the "middle place" is currently "size it however you like" is starting to wear on me.

I'm not sure if the infinite possibilities of window resizing is more sad than the fact that anyone who has a 15" or larger screen wouldn't take the time to maximize their window for readability.

If you've got an LCD, for goodness sake:

  • If you've got bad eyes, make the icons large and the fonts large. Really. Don't run your monitor at 1024x768 if it supports 1900x1600. You're doing yourself and your a disservice. Turn on ClearType.

If I had a nickel for every time I went into an Executives office and had this conversation, I'd like like 65 cents. At least.

    • "Hm, you're running your laptop at non-native resolution..."
    • "I am?"
    • "Yes..." click, click, right-click, enter, boom.
    • "Oh, wow, that is clearer. But the icons are small now"
    • "Ok. One sec" click, click, Large Icons, boom.
    • "Ah, that's nice. That text is kind of jagged."
    • "Ok. One sec" click, click, ClearType, boom.
    • "Wow, that's like getting new glasses."
    • "Yes. Yes, it is."

Make your pixels work for you, Dear Reader.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.