John's profileJohn BarshingerPhotosBlogLists Tools Help

John Barshinger

There's no need to fear, Underdog is here!

John Barshinger

Occupation
No list items have been added yet.

Feed

The owner hasn't specified a feed for this module yet.
October 09

ASP.NET UrlEncode? not so fast, grasshopper.

 
One would think using Server.UrlEncode() AKA HttpUtility.UrlEncode would take care of all the special characters in whatever string you pass it and return to you a URL that you can actually use. After all, that's what the name of the method implies, doesn't it?
 
Au contraire! a bad thing that UrlEncode does is replace spaces with "+". You would think this is ok and sometimes it is but sometimes it is not. The better thing to do is replace spaces with "%20". Luckily, there is a new method which does just that. If you are having problems feeding out URLs that work, try this method instead:
 
System.Uri.EscapeUriString()
 
--------
 
Qapla'
August 18

Intel X25-M SSD RAID 0 Performance/How to zero out/reset to factory performance?

This past weekend I bought a second 80GB X25-M from NewEgg.com because they were on sale for a good price. (note: I’m talking about Gen 1 X25-M’s in this article). I liked having an SSD running under Windows 7 for my software dev box so much that I decided it can only get better if I get another and stripe two of them in a RAID-0 set. I assumed this would help me in two ways: first this would give me approximately 150GB of disk space instead of 75GB; and second, I expected read and write performance to scale to almost double what I get in a single drive. Now read performance is excellent on a single drive, Intel claims up to 250MB/s. However, write performance, although good, could be better. Intel claims write performance of up to 70MB/s. So, I was expecting to throw these 2 SSDs in a RAID-0 set served up by the Intel ICH10R on my ASUS P5Q-E motherboard and get around 400MB/s read and 140MB/s writes. Here’s what I actually found:

test MIN MAX AVG Acc Time Burst CPU
SSD1-R 178.6 221.3 209.1 .1 98.8 2.8
SSD2-R 110.9 221.7 200.6 .1 101.5 2.7
SSD1-W .1 78.4 66.8 .1 98.9 1.8
SSD2-W 36.9 77.8 71.6 .1 101.2 1
STRIPE-R 145.3 336.7 258.2 .1 146.9 6.6
summed-R 289.5 443.0 409.7 .1 200.3 5.5
STRIPE-W .2 135.8 87.1 .1 95.4 2.2
summed-W 37.0 156.2 138.4 .1 200.4 2.8
STRIPE-W+ .7 152.5 116.9 .1 837.7 3.9

 

SSD1-R is the read results from HDTune for reading on my first Intel X25-M. SSD2-R is the read results from HDTune for my second Intel X25-M (both are using AHCI and treated as single drives in the BIOS). Similarly, SSD1-W and SSD2-W are the HDTune results for writing.

summed-R and summed-W are simply the sum of the results I got from both drives in individual Read and Write tests. These are the numbers that ideally I would like to see in the striped set.

STRIPE-R shows the actual numbers I got for reading the striped set of SSDs. STRIPE-W shows the actual numbers I got for writing the striped set of SSDs. STRIPE-W+ is the same as STRIPE-W except that I turned on write-caching for the RAID volume via Intel Matrix Storage Manager.

As you can see, the striped set got me nowhere near my expectations, every metric for STRIPE-R and STRIPE-W was much less than ideal amounts calculated by summing the individual drives metrics.

One thing that really bugged me was the very low MIN write times for the individual SSD test. Take a look at these pictures and you can see ridiculous spikes in the performance graphs from HDTune.

SSD1-W-BEFORE

SSD1-W (above)

SSD2-W-BEFORE

SSD2-W (above)

Those are not what I call pretty graphs. The thing to remember with SSDs (in layman terms), is that once every page on the disk has been written to, in order to write to that page again, the SSD must first erase (clear out all the electrons) in every bit on the page prior to writing the actual data. This could explain what we’re seeing above.

Now what about reading? Let’s take a look at those graphs:

SSD1-R-BEFORE

SSD1-R (above)

SSD2-R-BEFORE

SSD2-R (above)

The read graphs above are not too bad but still not very smooth. I have no explanation for this result…

Well, the next thing I decided to do was try to figure out how to restore these SSD’s to factory performance by clearing all the pages on each SSD. After searching for some time, I found this page: http://www.pcper.com/article.php?aid=669&type=expert detailing how to zero out the SSD’s. This page: http://www.pcper.com/article.php?aid=669&type=expert&pid=6 also provides a download link to the correct version of HDDErase that will work with these Intel SSDs.

So I went to work on zeroing out these SSD’s… Afterwards, I re-ran the HDTune tests and here are the resultant graphs:

SSD1-R-AFTER

SSD1-R (above)

SSD2-R-AFTER

SSD1-R (above)

Now those are some nice smooth read graphs!

SSD1-W-AFTER

SSD1-W (above)

SSD2-W-AFTER

SSD2-W (above)

Still a little spikey on writes but not bad at all! I’ll take it!

SSD-STRIPE-R-AFTER

STRIPE-R+(above) write caching turned on in Intel Matrix Storage Manager for this striped volume

nice and smooth, average 479.3MB/s reads, WOW!

SSD-STRIPE-W-AFTER

STRIPE-W+(above) write caching turned on in Intel Matrix Storage Manager for this striped volume

not bad at all! average 148MB/s for writes, now we’re talking!

-----------------------------------

Now what does this all mean??? For peak write AND read performance, we’re going to have to image our hard drive, secure erase each SSD, and then put the image back on our stripe-set. This really sux! The good news is that newer SSDs including Gen 2 of Intel X25-Ms will support TRIM which will automatically zero out the pages on the SSD that are no longer in use at more opportune times than when you want to write to that page. Windows 7 has TRIM built in, so you should be all set after some number of firmware and windows updates have been completed down the road when TRIM will be working in all its glory… Until then, image, secure erase, un-image for peak performance. Oh and don’t forget, each time you write or zero out a page on your SSD, that is one less time you will be able to write to it before it fails. They don’t call this the bleeding edge for nuthin, folks!

June 06

Forgot to enable AHCI on your Windows 7 RC (or Vista) for your SSD?

 
I was doing some reading tonight an found info implying that unless your SATA controller is set to AHCI or RAID mode (BIOS setting), performance improving things like NCQ and Trim do not work even if your SSD or hard drive (that was so 2008!) has those features available.
 
So, of course, changing this BIOS setting and expecting everything to work is just asking a bit too much (what do you think we're talking about, a Mac?). After making this BIOS change, you will soon see a beautiful blue screen of death otherwise known as BSOD. When this occurs, you will likely be googling around for some solution to the problem (after you change that BIOS setting back and reboot) or maybe you'll try the new Microsoft Bing (I didn't). In any event, hopefully you will find this blog entry or the link I will provide that should solve your problem.
 
http://support.microsoft.com/kb/922976 will show you how to make a registry entry change that will likely solve the problem for you. At least it did for me...
 
Here is the relevant info from the link above:
 
To resolve this issue, enable the AHCI driver in the registry before you change the SATA mode of the boot drive. To do this, follow these steps:
  1. Exit all Windows-based programs.
  2. Click Start, type regedit in the Start Search box, and then press ENTER.
  3. If you receive the User Account Control dialog box, click Continue.
  4. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci
  5. In the right pane, right-click Start in the Name column, and then click Modify.
  6. In the Value data box, type 0, and then click OK.
  7. On the File menu, click Exit to close Registry Editor.

After doing this, reboot, get into the BIOS, change back to AHCI mode and eventually you will be able to login to Windows (i.e. no BSOD). At this time, Windows will figure out that is needs to install drivers for your fancy new AHCI controller that replaced your old legacy controller (which of course forces you to reboot one more time) and then you are all set.

At least this is how it went down for me with Windows 7 RC (BTW: Windows users can be happy and proud again with Windows 7, Mac ain't got nuthing on you no more...at least until Snow Leopard comes out, then we'll just have to see...)

 

May 26

iPhone on Verizon?

I am using an iPhone on T-Mobile but am very hesitant to switch to the new iPhone coming out this summer on ATT even though I really want to. Why? It costs more per month and has only slightly better coverage than T-Mobile. Also, some of the restrictions on ATT just really rub me the wrong way. For example, SlingPlayer can only operate with WIFI? HUH? How can they charge me for “unlimited” 3G internet access and deny me the ability to use my SlingPlayer unless I am connected to WIFI? I used SlingPlayer years ago on T-Mobile with my window mobile phone and it worked just fine (no extra charge BTW)!

There is a rumor that Verizon may soon have an iPhone. Now that, my friend, is a differentiator! I could (and I may) still switch from T-Mobile to ATT in order to get the new iPhone this summer even though I will be paying more for less monthly. But I would JUMP at the chance to switch to Verizon if I could have the new iPhone on their network. I would even pay MORE per month than ATT charges. Why? Ubiquitous signal coverage (OK, maybe not ubiquitous but heck Verizon has coverage even in the western PA mountains that I visit every few years). Better signal strength indoors (isn’t this where most of us use our phones anyway?). 80 million customers...make that 80 million and 1, I hope. Why does this matter? FREE MOBILE TO MOBILE. And besides that, when they acquired AllTel, the created a “My Faves” like plan that T-Mobile has. With this plan, you can pretty much have UNLIMITED calling minutes while paying for the least minutes plan under certain conditions (ask me for details if interested, you'll need Google Voice previously known as GrandCentral).

OK, I am done ranting for today. I feel better now. C’mon Verizon, step up to the plate (QUICK)!
April 23

asp Checkbox css style on the input element

 
when ASP.NET renders an <asp:Checkbox... /> it renders HTML similar to this:
 
<span><input type="checkbox" ... /></span>
 
When you want to specify the height of the checkbox for example. You would think something like this would do the trick:
 

checkBox.Height = Unit.Pixel(12); // this is needed for IE8

This actually does the trick for IE8 but not for IE6. Now this is rendered:
 
<span style="display:inline-block;height:12px;"><input type="checkbox" ...  /></span>
 
For IE6, the following code must be used:
 

button.InputAttributes[

"style"] = "height: 12px"; // this is needed for IE6
button.InputAttributes["height"] = "12px"; // this is needed for IE6
button.Height = Unit.Pixel(12); // this is needed for IE8

This actually does the trick for both IE8 and IE6. Finally this is rendered:

<span style="display:inline-block;height:12px;"><input type="checkbox" height="12px" ... /></span>

This was a PIA for me to figure out, I hope this helps you if you run into a similar formatting issue with ASP.NET Checkbox controls.

 
January 06

WinMerge integration with TortoiseSVN

 
sometimes, the magic command used to integrate WinMerge as the Diff Viewer for TortoiseSVN gets lost. I aways forget what that command is so I am documenting it here (so I don't have to look it up again):
 
TortoiseSVN -> Settings -> External Programs -> Diff Viewer
 
Click "External" and enter the following (adjusted with your path to WinMerge, if necessary):
 
C:\Program Files (x86)\WinMerge\WinMergeU.exe -e -x -ub -dl %bname -dr %yname %base %mine
 
If you want this automatically setup for you. Install WinMerge AFTER you install TortoiseSVN and check the box that says integrate with TortoiseSVN.
 
I feel better already...
 
 
November 10

Windows Update fails to install updates

 

Today I ran into a computer where windows update would download updates from Windows Update and would start the installation process before finally failing to install any of the updates. No reason was given for the failure. Looking at the update history, where one would expect to find the error, did not even have the update attempt listed.

First, where to find more information about the errors related to Windows Update: c:\windows\WindowsUpdate.txt. You might find some clues regarding the problems there. I Google'd on a couple of errors listed there and found the following solution for the problem I was experiencing.

Solution (re-register these dlls):

regsvr32.exe c:\windows\system32\wuweb.dll
regsvr32.exe c:\windows\system32\wups2.dll
regsvr32.exe c:\windows\system32\wups.dll
regsvr32.exe c:\windows\system32\wucltui.dll
regsvr32.exe c:\windows\system32\wuaueng1.dll
regsvr32.exe c:\windows\system32\wuaueng.dll
regsvr32.exe c:\windows\system32\wuapi.dll

Next, restart the Automatic Updates server (you might have to reboot to get Windows Update working in IE).

This problem was on an XP system for me but I have heard this also affects other Windows OS's.

 
Photo 1 of 2