Tag Archives: Windows Vista

Using Windows Performance Toolkit to find System Issues in Vista/Win2k8/Win7

Windows 7 RC1 just came out. I am a TechNet subscriber, so I wanted to try it out. I have an old (2005) Dell desktop, 2.8 GHz, 2 GB ram, 160 GB drive box. 3.7 rating for Vista (because of the Graphics card mostly, would be 4.4 otherwise – not too bad, even for being kind of an old box). It has been sitting in the basement since I moved into my new place in October, doing nothing really. I use Mac full time at home, so it just sits.

A few times I have tried to get Windows Vista running smooth on it, Media Center, or just a file server,etc. Thing is, it was just flaking out. I knew it was a hardware issue, but figured it might be the CPU fan, or overheating, etc. Vista installed fine, but as I was using it, I would see just hang-ups, lockups. Not BSOD’s, but it would just hang, for 30 seconds, 1 minute, and then come back. WTF?

Nothing in the Reliability monitor, nothing I could see in event logs, etc. I rebooted, did Windows Memory test, nothing there. If you go into Computer Management, you will see Performance, then Data Collector Sets and Reports, Monitoring Tools. You can set it up to run a test on metrics of your system and it will give you a report

image

I did this, and everything was ok. BUT… Avg Disk Length Queue was > 2 – red flag. Disk issues. But I wanted to know more. So I started digging around, and there is a Windows Performance Toolkit you can download. Here is another good site going into detail about the WPT.

So I fire up cmd line (as admin! – start->run, cmd ctrl+shift+enter), and run

xperf -providers K

to see what providers are available for the Kernel flags. IOTrace looks like something I want, so I then run

xperf -on IOTrace

and let it run. I go and open/close things, play around, see if I can replicate the issue. Once I feel I have, I want to stop and analyze the trace. You need to stop it and output to a file using this command:

xperf -d iotrace.etl

Side note: Files are named ETL. Coming from a BI background, this makes my world explode, since it has nothing to do with Extract, Transform, and Load

Now that my trace is done, time to analyze:

xperfview iotrace.etl

And you get some awesome stats like this:
image

Although I didn’t save my stats from my tests that showed the bad IO, what I saw were just gaps in the graphs, glitches in The Matrix. Time missing. Something is really bad here. So I did the drive error checking in Vista:

image

And when that ran, after reboot, it got to 11% and croaked. Bad drive. So I went and bought a new 500 GB SATA drive and loaded it up, and I am running Windows 7 now. Pretty sweet.

After all this fun spelunking into Windows performance, it also got me thinking about things, like running these detailed traces on SQL Server boxes or other servers on intervals, and saving them somehow, reporting on the data. The IOTrace is just one of hundreds of traces, that you can then auto analyze. I know that there are perfmon tools but there are some added benefits to xperf that you can you utilize, and I am glad I learned more about it and put it to use, just another tool for the sysadmin tool belt.

Ubuntu 8.04 Hardy Heron – Second Chance, Wireless Works and was Easy!

So, last night I decided to give Ubuntu 8.04 Hardy Heron another try. I blogged previously about setting it up and getting wireless to work, and what a nightmare it was

What I did this time was this. First off, I have computers everywhere, a MacBook, MacBook Pro, Dell Desktop and Dell Laptop. I have Vista on the desktop, and the Dell laptop I wasn’t doing much with, so I decided to load up Ubuntu on it. After installing, I connected it to a wired connection, downloaded the OS updates and let is sit for a while. After a few minutes it popped up with an alert telling my that there were updated drivers for the BroadCom wireless nic card. Wha?!? I open the alert, hit enable, and it downloads new drivers and fwcutter and lo and behold, wireless starts working with no hassles. I am on Ubuntu right now dinking around. So what is the first thing I do? Well make it look like a Mac of course.

So now I have Mac OS 10.5, Vista, and Ubuntu 8.04 all running on different machines. I would say right now though I do like the Mac the best. I use Vista for anything that really needs Windows. I will probably setup VMWare Fusion again on the MBP, but a smaller partition. I moved all my music there (80+ GB) and had to free up some space, my Vista partition was 60 GB.

Ruby on Rails and MySql .. on Windows Vista

So, this evening I got the urge to get Ruby on Rails working on Vista, with MySql. I haven’t done much with RoR, but figured I would give it a go. I have this test hosting account that has RoR hosting, so that is what got me somewhat motivated…anyway’s, on with the show.

 

Install Ruby

Installing Ruby is pretty easy. You can follow the tutorial pretty much step by step from the rubyonrails.org site, except it is tailored to *nix machines (Mac, Linux) as far as paths and stuff..

1) Download and install ruby..(http://www.rubyonrails.org/down)

2) get RubyGems, run ruby setup.rb

3) Get rails:…. gem install rails –include-dependencies

Create Application

At the command prompt:

rails c:railsblog

cd railsblog

ruby script/server

test it on http://localhost:3000

if all is well, you will see a cool welcome screen..

Now.. lets actually start making our blog app by generating a controller..(remember , you need to call “ruby” before executing these scripts.. in Mac, etc you don’t have to)

ruby script/generate controller Blog

Then edit your blog_controller.rb and add some code:

class BlogController < ApplicationController
    def index
        render :text => “Hello World!”
    end
end

try it (http://localhost:3000/blog).. whoops.. error?

no such file to load — sqlite3

check under your app dir (c:railsblog) your configdatabase.yml

it is set to sqllite.. we need to get MySql installed and configured

Install MySql (5.0.51a)

This is a whole nother debacle. MySql doesn’t really work right on Vista.

download MySql (http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.51a-win32.msi/from/pick#mirrors), install it

you will notice.. the config assistant doesn’t run at the end..

Configure It, Hack It, Swear At It

First, in the MySql/bin directory, set both the MySql config assistant and the mysqld-nt.exe to run in XP Sp2 compatibility mode, and run as administrator (this will
allow the service to start once the config assistant is done, once we hack to run anyway’s)

In your application logs in event viewer you will see

Activation context generation failed for “C:Program FilesMySQLMySQL Server 5.0binMySQLInstanceConfig.exe”.
Error in manifest or policy file “C:Program FilesMySQLMySQL Server 5.0binMySQLInstanceConfig.exe” on line 6.
The value “asAdministrator” of attribute “level” in element “urn:schemas-microsoft-com:asm.v1^requestedPrivileges” is invalid.

Nice..

I guess older version work, but 5.0.51a doesn’t. You can see in the error, “asAdminstrator”, it should be “requireAdministrator”, we need to hack the exe..

download resource hacker – http://www.angusj.com/resourcehacker/

Open the MySqlInstanceConfig.exe in Reshack, ctrl+f, search for “asAdministrator”, change to “requireAdministrator” save and compile the exe over the old one..

Whoo hoo! The config assistant runs!

Basically the defaults, except I chose

“multilingual” on the character set screen,

and checked the “Include Bin Directory in Windows PATH” box on the Windows Options Screen

and – setup a root password on the security screen!

after it is all done, I like to secure my local machine, go to the my.ini in your MySql directory, and under the [mysqld] add

bind-address=127.0.0.1

so only local apps can connect..

Test MySql by opening a cmd prompt,

mysql -h localhost -u root -p

hit enter, it will ask for a password , and you should be able to login

Configure MySql For Our App

login to MySql using the cmd above..then

CREATE DATABASE blog;
CREATE USER ‘blog’@’localhost’ IDENTIFIED BY ‘blog’;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON blog.* TO ‘blog’@’localhost’;
FLUSH PRIVILEGES;

quit

Now we have a database called “blog” a user called “blog” with password “blog”

We need to tie Ruby to MySql now…

run..

gem install mysql

now, you probably have your mysql directory in your path, but since you need to restart your machine or explorer for new paths to show up, it doesn’t work yet..
so we need to make sure we do that, otherwise, if you try hitting http://localhost:3000/blog you will get a libmysql.dll error popup. I just killed explorer.exe and
start->run explorer in task manager, and then hit http://localhost:3000/blog again and saw the “hello world”

Yesssss… it works. Now , for the fun stuff, actually coding and creating tables, and more!!!!

Windows Vista vs. Windows XP Debate. Who Wins?

I have been using Microsoft’s Windows Vista since it came out RTM, Oct 30 2006. I had it on a Dell desktop, which worked fine. Some driver issues before January 2007, but it still worked. I have had it on my main Dell laptop since May 2007. I use this laptop for work (read: Visual Studio 2005, 2008, SQL Server, Office 2007 etc, etc)

I started using XP the same way since it came out in 2001. Even though, at work, I was forced to use 98/2000 for a while, but I had XP running at home, and ran it all they way up till I installed Vista fresh.

Now XP SP0, was very buggy, driver issues. Same with Windows 2000, SP1 came out and a lot of issues were fixed and it was more stable, yet insecure. SP2 fixed most of the big problems and it was very stable, mature OS, and now SP3 is RTM which adds a few hidden features, as well as all the security patches since SP2. Good deal, yeah, XP is stable, mature and works. Guess what? So is UNIX. It doesn’t mean we want to use it on our machines.

Vista is the new OS in town from Microsoft, and it works just fine. Great almost. Yeah, you heard me right. It works, it doesn’t suck, and yeah, it is better than XP.

Anyone who says otherwise either

a) Doesn’t know how to setup and work Windows

b) has hardware that they can’t get working

c) has an OEM machine full of bloatware slowing it down

d) doesn’t know how to tweak a machine for performance.

e) they haven’t used Vista (because of work reasons or whatever)

Yes, XP works, it works well, for people running Compaq Pesarios or HP machines that are 5-6+ years old. It works well for Linux geeks who really don’t know how to work Windows. It works well for Mac people that need Windows every now and then.

But Vista, just works. My desktop was purchased in Nov 2005. 2 GB of ram. Vista works like a champ. Laptop in May 2007, once again, runs like a champ. Even my MacBook with 1GB runs Vista very well using Apple’s Boot Camp.

Vista IS more secure. You can run it without added bloat of an antivirus/spyware in my opinion. And if you are behind a router, you don’t need a firewall. Now, in XP’s case.. you probably need all three, just because XP is more vulnerable, and when by chance it does get hit by malware, it makes it MUCH harder to get it off XP (I know from helping people) compared to Vista.  Vista has built in tools to identify rouge programs, processes, and things that just shouldn’t be there. It gives you more insight into what is going on – the control panel has tons of options to monitor everything, and, Vista is locked down by default.

Yes UAC is a pain. I disable it, I am a power user. You don’t even need to be a power user, just a smart user. Don’t install crazy things, use Firefox, things like that.

I have been using Mac OS 10.4 and 10.5 now for about 6 months. It is OK, it works, depending on what you want to do. If I wasn’t a Windows developer, I could get by on Mac. I could get by on Linux (I have used it on and off for 8 or so years). But could an average user get by on Linux? No. That is why Linux will never become mainstream for end users – it is too difficult. Even Mac/Windows (and pssst Linux) geek’s give up on Linux because it is just too damn non-user friendly sometimes. No, I shouldn’t have to recompile my kernel to get wireless working. No, I shouldn’t have to edit config files ANYWHERE to change settings, not as an end user. As a power user, yea, that’s fine.

Back to XP vs. Vista – the petition to keep XP alive is just like trying to keep VB6 alive – it will always fail. VB.NET is superior to VB6, Vista is superior to XP – it just is. Vista MCE is much better than MCE 2005, just a ton more options and features, and it works, I could just keep going on and on listing feature comparisons, but it isn’t worth it.

I can say from experience, that Vista wins this war with XP, and until someone can convince me, that is how I roll :)

Updated to Leopard

Yesterday I picked up Apple’s latest OS, Leopard OS X 10.5. What is really cool is the boot camp feature. I am now dual booting Windows Vista and OSX on my little 13 inch MacBook. If I had the cash I would have gotten a MacBook pro, but it is just so expensive. I have 37 GB partitions for each OS, so not huge, but it works.

I do have a USB hard drive (250) that I use for OSX, and then I have one for Windows, so it is all good. Installing OSX was easy, few clicks, done. Did the updates, etc. Then ran Boot Camp assistant, rebooted, installed Vista, put in OSX DVD, installed the rest of the drivers needed, and then did the Windows updates.

Pretty slick setup. I might get some more RAM for this laptop, since it only has 1 GB, but it is performing OK.

I don’t think I will ever buy any new laptop that isn’t a MacBook (preferably a MacBook Pro). There just isn’t any other way to go IMHO.

Windows Vista Customer Experience Program – Why Do I have To Click “On” Then “Off” Again?

image

After installing Microsoft Windows Vista SP1 – This pops up, just like when you install Vista fresh.

What gets me, is that the OK button is grayed out by default. I have to first click on the “Join the Windows Customer Experience Improvement Program” radio button and then back on “I Don’t want to join the program at this time” . Why is this? I want to just hit OK with the default choice. Just irks me I guess :)