Description of the hard disk cache
19 April 2007 by Snakefoot | Comment » | Trackback OffThe hard disk is extremely slow compared to physical memory (RAM), but provides lots of storage capacity.
Disk caching can be used to speed up the harddisk performance. The disk cache uses RAM to provide quick
access to frequently accessed data.
There are different levels of disk caching:
Windows 3.11 had a flaw in its flush operation, so it actually just performed a lazy write to the cache when an application performed a flushed write. Several applications was created which was littered with flushed writes, because it performed so well. These applications performed miserable when used on Windows 95, which didn't have this flaw when performing flushed write, and naturally was much slower than just writing to the cache. One could activate the old buggy behavior by with the option to "Disable Synchronous Buffer Commits", which was hidden away in the troubleshooting section.
Later as server environments have become more and more stable with duplicate power supplies and UPS equipment, then the idea of actually ignoring the flush request has become a wish for those where high disk performance is critical. The Windows operating system can convert the following requests to normal I/O requests so the cache buffers are not flushed:
It is also not recommended to change these requests if running a Database Management System (DBMS), as these requests are used to create stable commit checkpoints before beginning on a new transaction.
More Info Microsoft - Windows Confidential: The Power of Bugs
Related Configure IDE ATA hard disk for best performance
There are different levels of disk caching:
- Hard disk Cache - Cache is located on the hard disk device and works only with sectors. It allows continuous reading from the disk even if the transfer-bus is busy.
- Disk controller Cache - Cache is located on the controller card and works only with sectors. It allows reading from disk without using the transfer-bus to contact the hard disk.
- Operating System Cache - Using RAM as hard disk cache and works on a file level. It allows file access without using the system-bus to contact the disk controller.
- Vista Readyboost - Cache is placed on high speed USB flash drives, which allows faster seek times and higher constant transfer rate than the HDD. Can deliver a very large and fast hard disk cache, though still slower than RAM.
- Read Cache - Allows the hard disk to read data ahead in the background, so the application doesn't have to block while waiting for the data to be read, but gets the data delivered from the cache instead.
- Write Cache - Allows the hard disk to lazy write data in the background, so the application doesn't have to block while waiting for the data to be written, but enters the cache where it is later written to the hard disk.
Windows 3.11 had a flaw in its flush operation, so it actually just performed a lazy write to the cache when an application performed a flushed write. Several applications was created which was littered with flushed writes, because it performed so well. These applications performed miserable when used on Windows 95, which didn't have this flaw when performing flushed write, and naturally was much slower than just writing to the cache. One could activate the old buggy behavior by with the option to "Disable Synchronous Buffer Commits", which was hidden away in the troubleshooting section.
Later as server environments have become more and more stable with duplicate power supplies and UPS equipment, then the idea of actually ignoring the flush request has become a wish for those where high disk performance is critical. The Windows operating system can convert the following requests to normal I/O requests so the cache buffers are not flushed:
- Write Through - Performs a write to disk without using the cache. Activated by calling the Windows API WriteFile() with FILE_FLAG_WRITE_THROUGH. Sends a Forced Unit Access (FUA) command to the storage device.
- Flush Buffers - Tells the disk to flush everything it has in cache. Activated by calling FlushFileBuffers(). Sends a Synchronize Cache (SCSI) or Flush Cache (IDE/ATAPI) command to the storage device.
It is also not recommended to change these requests if running a Database Management System (DBMS), as these requests are used to create stable commit checkpoints before beginning on a new transaction.
- Windows 2000 SP3 / XP SP2 - Requires the utility Dskcache.exe to enable Power Protected write cache. More Info MS KB Q811392, MS KB Q332023
- Windows 2003 / Vista - The option with the misleading name "Enable Advanced Performance", which can be found on the "Policies"-tab for each hard disk device in the "Device Manager" (Have to activate "Optimize for performance" and "Enable write caching on the disk").
More Info Microsoft - Windows Confidential: The Power of Bugs
Related Configure IDE ATA hard disk for best performance
Tags:
Category:
Updated: 15 July 2008
Comment by Doolittle - 21 May 2007 @ 7:04 Reply
Hi got another question If I may.
I did a bit of hunting around for info on the Dskcache utility. I downloaded and applied the hotfix that enables Xp to use the utility.
Having trouble finding the file, only option seems to be MS support and it is highly confusing and involves using one of 2 free support questions as far as I can tell.
If you have the file could you give me a link to download or even Email to me?
** Email address removed by moderator **
Pagefile is working like a charm now, (always was I know, but I couldnt see it) I set up a windows controlled pagefile on C:\ the tool you advised me to use tells me it is using just 6 megs of 3 Gb even when I heavily load Ram, so I am happy now.
All the best
Chris