Defragging your hard drives is still important

Tuesday, 29 June 2010 22:25 by Greg

Hard drives are like libraries.  There are rows and shelves and books that make up a body of information and knowledge.  If you are looking for a particular book, you look it up or ask your friendly neighborhood librarian and walk (or hike) to the spot.  You find your book after scanning the shelves for a few and are off on your business.  So too is it with your hard drive.  They have blocks and sectors and files that consist of your files and programs. 

Now think about if you had to find 10 books in the library instead of just one?  You would have to find all the different spots where those books are, head to those shelves, and grab your book.  Your library may still use the Dewey decimal system to classify books, placing them into knowledge classifications rather than by author or title.  This would be inconvenient if you had 10 books all starting with the litter “A”.

Your computer has a lot of files to load when you turn on your computer, or load your favorite game.  If these files are next to one another that program loads fast.  If not, its slow and you consider buying a new computer.

Enter the concept of disk defragmentation.  Instead of alphabetizing your hard disk, it places like files next to one another.  Maybe by application, maybe by other means.  By default Windows writes files out where there is space.  It may put part of a file here, another part here, and so on for thousands of files.  The more files and programs loaded onto a computer, the more scattered they can become.  Its a major reason why a new computer appears to work fast, but over time slows down.

I’m not going to get into the “why” behind this happening, enough to say it would be nice that it didn’t.  Fortunately there are several products to combat this.  I’ve personally used the following:

Defraggler was by far my favorite until recently.  It did a good job of keeping the files in order, even shutting down my computer when done.  It had the bonus of actually displaying the defrag status.  All this for FREE.

And then I received a promotional copy of Diskeeper from TechEd.  I used Diskeeper years ago and liked it then, but stopped using it after a while.  Mostly because I didn’t want to pay for the license, and partly because their tool appeared to be as good as the free ones.  I was wrong.

There is an interesting new product called Soluto – Anti-frustration software.  The major thing this free product does is graphically show how long it takes for your computer to boot, why, and how to fix it.  Many vendors have pieces of their programs that load when a computer is turned on that serve a variety of purposes.  Some to make it so their program appears to load faster, others to fetch updates.  More often than not it takes an experienced person using MSConfig or CCleaner to remove unneeded things from system startup.

I tend to defrag my disks weekly using Defraggler.  After I did my first full defrag with Diskeeper I rebooted and saw this with Soluto.

image

My boot time dropped from 1:30 to 1:15 just by defragging my hard disk with Diskeeper.  A new feature in Diskeeper 2010 is their “Invisitasking” which defrags the drive while the system is idle.  I really don’t like these features as they tend to still draw CPU away from other important tasks, like Team Fortress.  But I gave it a shake and let it run, and low and behind not only didn’t I see any loss of game-play performance but it also cut my boot time by another 15 seconds.

Or, to properly call this out, using Diskeeper 2010 reduced my boot time by 30 seconds.

NOTE: the rise in the Soluto line has to do with me installing a variety of applications and service packs and I haven’t tried a reboot in a while.

As I mentioned earlier, I was given this copy of Diskeeper 2010 before writing this article.  I wanted to pass along my experience and give credit where credit is due… and to insert Amazon links :)

Diskeeper 2010 Professional Single License Pack is available from Amazon.com for $60 at the time of this writing.  Also get a 30-day free trial from their website and see for yourself.

IIS performance considerations

Monday, 7 June 2010 23:48 by Greg

Thomas Deml from Microsoft gave a great discussion on “My website is slow!  And I don’t know what to do about it!”  Its an aptly named topic.  I spend a great deal of my day looking at performance issues with the shotgun approach.  If key performance indicators aren’t out of whack, figuring out what to do next is a challenge.

Thomas went into detail on a number of things to examine and try.

First off, if you are not yet using Fiddler, go get it.  The tool examines network traffic to and from a client and is a key tool to helping understand web page load times.  Specifically, there is a WCAT (web capacity analysis tool) extension that can be used to simulate load on a server.  While less precise than other stress test tools, this along is better than nothing and looks to help with ensuring the basics are set.

I’m going to interject a few items from my own experience, including the fact that many of these options are available for Windows Server 2003… not just Server 2008.

IIS tweaks

  • Ensure default.aspx is your top default document.  Its not a huge change, but with each document request where a document is not specified, like your home page, IIS checks this list in the order shown.  So if you are running .NET or PHP, make sure that handler is listed first.
  • Turn off authentication or SSL if not used.  This is especially true with home and static pages.
  • Use the browser cache!  On static content pages and folders, set content expiration to 365 days.  This sends a HTTP 304 response on content requests.  As the browser requests the file, if it receives the 304 the file is not downloaded.
  • Removed x-powered-by headers.

Server 2008 specific settings

  • Use IIS output caching of semi-dynamic content.  These are non-user specific settings that will span multiple sessions and help improve performance.
  • Turn off request tracing except when troubleshooting performance.

Things you can (and should) do with .NET.

  • Use the ASPNET compiler tool to pre-compile the web application.  Normal operating mode is the first user to request a page will cause that page to JIT, or just-in-time compile.  This means that the first user to hit the page gets the delay, which is often not acceptable.  This tool will precompile all pages within the application at once.
  • Watch object size.  An object larger than 85k is treated differently in the .NET memory management model and is garbage collected differently (less frequently, if at all).  Smaller objects with shorter life spans will improve performance.
  • Perform IIS tuning.  By default IIS will handle a max of 12 concurrent connections, which may be fine for entry level sites.  Maybe not so much in the real world. 
  • As much as possible, don’t use Viewstate.  This is different than ControlState.  Viewstate adds a lot of bytes to the page.

Improving performance by reducing bytes transferred.

  • Use output caching.  The demo showed a 5x improvement in performance by just flipping the switch.
  • Use the free Microsoft content delivery system for standard JavaScript libraries for Ajax, jQuery, and the .net framework.  The code files are a standard component of the .NET framework and this will offload its download from your server.  Further, it will span servers and applications and will help cache these larger .js files.
  • Crunch production ready JavaScript and .css files with AjaxMinify or Doloto.  This removes comments and simplifies variable names.  The net result is file reduction and smaller downloads, but should be used for production deployments only. 
  • Ensure that image files are not being scaled by HTML.  If an <img> tag specifies a width of 128 bytes, that should be the size of the image.  Otherwise you are downloading extra bytes (slow) and forcing the browser to do the resizing for you (slow).
  • On the topic of images, use .jpg files for photos and .png for graphics files.  Remember to remove .jpg file metadata, as this adds bytes that doesn’t help anyone.

And the biggies; ensure .css tags are at the top of the file and <script> tags are at the bottom.  Native behavior of IIS suspends all other downloads across all download threads when it encounters a script tag.  If if this is a big chunk of Ajax JavaScript, it will give the appearance that the server is thinking long and hard on your page request.  Given the attention span of the average Internet user is 4 seconds, that may be too much.

This was a great session and a lot of good tools and techniques to try out.  Well done Tom!

Tags:   , ,
Categories:   Professional | Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Creating a bootable USB thumb drive

Friday, 4 June 2010 17:04 by Greg

Because who has a 3.5” floppy disk anymore, really?  For many years as a system builder and tech it was handy to have those red disks that could be used to bypass any operating system and solve lots of problems. That capability is still around with just a little extra effort and the right software. 

First, of course, you need a USB drive.  Depending on what you want to use it for (say, loading an OS or just running a BIOS update) will determine how big you go.

Second, you need the right software, and that’s UNetbootin.  For just about any time of lightweight OS distribution, this open-source freeware app does what it takes to turn your USB thumb drive into one of those magic floppy drives.

I had to reinstall the BIOS of my Acer Aspire netbook, down to version 3005 from 3009.  The later version spiked the CPU temp which caused shutdowns during boot where I thought I lost the machine.  I found this utility, created a 1GB “floppy” with the BIOS flash software, and sure enough it ran.

Once again, open source to the rescue!

Tags:   , ,
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Free training CD's from our friends at AppDev

Thursday, 27 July 2006 12:07 by Greg

http://www.appdev.com/promo/freecd.asp?PC=SN00030

Tags:  
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Improved font for VS2005

Thursday, 20 July 2006 12:07 by Greg

Ever confuse a O with an 0 in code?  How about a 1 or a l?  The Consolas programming font was originally designed for Vista, but has been released for anyone using VS2005 and ClearType.  Pretty cool stuff!

http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en

Tags:  
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Download MS Virtual PC for free!

Thursday, 13 July 2006 07:07 by Greg

http://www.microsoft.com/windows/virtualpc/default.mspx

If you haven't yet used Virtual PC to play with Vista (or other OSs), create a very robust development environment, or you REALLY enjoy reloading operating systems, go get it as a free download from Microsoft.

Tags:  
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Intellisense for SQL Server editors

Friday, 26 May 2006 07:05 by Greg

http://www.red-gate.com/products/SQL_Prompt/index.htm

Basically, install it, run query analyzer, type "select * from " and BAM!  Full list of tables.  Type over the * and BAM!, list of columns and functions.  Pretty darn cool!!!
And, its a free download until September 2006!
While it supposedly supports query writing inside of VS2005, I haven't found a way to get this to work.
[Found via Scot Gu's blog]
Tags:   ,
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Looking for a new FTP client?

Tuesday, 16 May 2006 06:05 by Greg

http://sourceforge.net/projects/filezilla/

I'm very impressed by this open source project.  Connection management is simple and straightforward, as is transfers, queuing, and status information.  You get a lot of status information, which is great for troubleshooting.  Congratz to this team for designing and executing a great app!

Tags:  
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Resharper 2.0 Beta!

Tuesday, 25 April 2006 06:04 by Greg

Woo hoo!

http://www.jetbrains.com/resharper/beta20.html

And current customers get the next version free!  This continues to be the best $99 I've spent on a software tool!  WOO HOO!

Tags:   ,
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Can't hibernate?!

Friday, 14 April 2006 19:04 by Greg

One of the few upgrades I've made to my Dell I8600 over the past two years was adding RAM.  First to 768MB, then recently to 1.5MB... and I'll swear that the last upgrade made a great difference.  Except that now I can't hibernate every other attempt.  Let me be specific; if I am off a fresh boot, run Outlook and surf the web, I'm fine.  But anytime I fire up a SQL server or do some coding, forget... I get the dreaded "Insufficient resources to complete this API".  1.5 GB of RAM, excuse me!

Found this note on a hotfix that was released last month that supposedly resolves the problem.  We'll see!
http://www.codinghorror.com/blog/archives/000555.html

Tags:  
Categories:   Tools
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed