Saturday, September 6, 2008

Windows XP: Hibernating Taking a Long Time

On my laptop I have been running Microsoft Windows XP, or sometimes known as WinXP. I use Service Pack 2 and havent' had any show stopping problems. However, at one point my laptop would hibernate in about 20 seconds or less. To determine if that is fast, you have know my equipment: a dual core 2.2mhz pentium and 4gb of ram. The problem is that somewhere along the way hibernation began to take 5 to 10 minutes (yes, minutes). I never really bothered to time it in full because it took so awfully long. After about 2 years of on and off searching, I found the soloution! First, I'll tell you what I tried.

Network Maps

I looked at the network maps I had setup for access to network disk drives. I had not only a Buffalo TeraStation Pro which I had mapped various drives, but also a SonicWall TZ170 firewall and router. Since I used the router's VPN service to connect to work, I thought maybe the mapped drives to the servers at work, through the VPN caused a slow hibernate.

Why would I think that network connections would slow down hibernating? Well, I know that networking can cause delays. Anyone that has tried to browse the network places through Windows experiences delays in refreshing available computers and connections. I figured maybe through the hibernate process went to check each drive and had to page through a network service to get there.

My logic was flawwed in that removing all VPN and networked drives did not speed up the hibernation process. Failure number one and one step closing to the solution.

Bluetooth

I understand that bluetooth incorporated into some motherboards or through other hardware modules can cause delays when periodically looking for devices. I don't use bluetooth very often with my laptop. I occasionally would synch my palm pilot or blackberry through bluetooth if I didn't have my cord with me, but not often.

Another failure as disabling bluetooth in the bios had no effect in the length of time to hibernate.

SQL Services and Pervasive SQL

Now I thought I was being brilliant again by looking at SQL services and similar database drivers. SQL is a very robust service and I had the full development edition on my laptop because I was doing Visual Studio programming at the time. I figured an enterprise level of SQL may have fairly intense routines going on behind the scenes to be sure that database integrity was kept during a shutdown or hibernation.

I even went so far as to remove SQL from my computer. The same was true for Pervasive SQL which I used to operate the Timberline Accounting System.

Once again, I failed and the hibernation process took an extremely long time.

Power Program Updates

Having a laptop and having a Dell Lattitude laptop which was a business class, gave me access to a download area where I could keep my operating system drivers for the laptop up to date. Using the Dell web sites I downloaded and ran patches on the Power system and other operating system items.

Guess what? Correct! No effect on the hibernation speed.

Solution

I can now say, similar to Thomas Edison, I now know many ways NOT to speed up Windows XP hibernation, but I did find one way that works!

Through an accidental re-post in a very obscure forum, I found an answer. Keep in mind that I had googled all sorts of phrases related to long hibernation times and never had I realy gotten an answer. In this case I did get an answer.

The post mentioned that removing the ability in Windows XP to provide write-caching to the hard drive in your computer can cause extremely long hibernate times. The testing for this solution was to enable write-caching for the disk drive on my laptop. As the post suggested, after I rebotted from making the adjusstment, the laptop hibernated in 15 to 20 seconds.

How incredibly strange! I know that I was writing 4gb of memory to the hard drive and that takes a minute, but how can it go from SOOOO slow to SOOOO fast? Even with caching, the full amount of data must be written. I can only assume that Microsoft performs hibernating at some base hardware level with no caching of any kind. Write, fetch, write, fetch and that this process is very slow.

Write Caching Dangers

Without trying to go into all the details, write-caching can be dangerous. Sudden power outages can cause a few operating system files to be left open potentially rendering your computer un-bootable. That is the very reason I disabled the Write Caching to begin with.

I have decided, since most of my photoraphy data is on outside disk drives and I back up my data and catalog regularly, that I am willing to take the chance on write-caching for my laptop. On my desktop, there is no reason. I can shutdown and bootup easily as there is not battery and it has a much faster processor (dual core 3.4mhz pentiums).

Just so you know, I purposely did not show you how to enable the Write-Caching on your Windows XP operating system. I still think it is a dangerous feature and wouldn't recommend using it. I would hope Microsoft will fix this issue and take advantage of caching for purposes of hibernation regardless of the operating system's settings. However, I don't want responsibility for your data and there is plenty of information on the internet to allow you to enable write caching.

Conclusion

For my work, hibernation can be important for the portability of my laptop. Thus, I am taking the risk of using write caching to enable quick hibernation. The choice is completely yours. At least now you know why it is taking so long to hibernate and you can make an informed decision.

Good luck!



Don't forget to visit my photography web site where we sell museum quality black and white prints framed to last up to 175 years - Outdoor Images Fine Art.

6 comments:

mbecher said...

Wow, nice finding. But I'd rather turn off hibernation and use standby (which of course needs some power). Also, if hybernating takes longer than 20sec. I'd shut the computer down (which will also free memory). Just my 0.20.

Outdoor Images said...

I agree about shutting down the computer and in fact I shut mine down when I'm finished all the time for 'clearing memory' just as you said. What I like about hibernation is either being away from my office or working for an hour or so and then hibernating so I can pickup later where I left off. I probably use hibernation on the weekends more than any other time - a product of starting and stopping so I have family time too!

Thanks for the comment!

Mark Levison said...

Radical suggestion that will undoubtedly earn the derision of some. Use Vista. It has Sleep. Much faster than Hibernate while using only a tiny amount of power, my laptop will last the weekend on sleep without being plugged in.

In addition inspite of all the other negative comments I can tell you it mostly works.

Outdoor Images said...

Mark, sleep is a neat function and XP has it to. Unfortunately, when I put the computer in my bag in between locations, I don't feel comfortable leaving the power on. I get really concerned about overheating and some sleep modes in laptops don't park the harddrive like they should.

I'm glad the power management appears to work so well in Vista!

roberto said...

didnt work forme , as i have already enabled caching

but my froblem is different as sometimes i get long times from both suspend and hibernate.

just wake up from suspend and it took 1:20.

Anonymous said...

I had the same problem with my dell inspiron 6400, but write caching was already enabled - as it is by default when you install XP. After weeks of searching, & trying stuff that didnt work I turned hibernate off (which automatically deletes hiberfil.sys) then defragged the drive, then turned hibernate back on & it now works perfectly!