Level-2 Cache

This document gives a detailed explanation of level-2 cache. As you may know, PrimoCache implements a two-level caching architecture consisting of level-1 cache and level-2 cache. Level-1 cache is composed of physical memory while level-2 typically resides on a solid-state drive or flash drive. The purpose of level-2 cache is to increase the read speed of traditional mechanical hard disks.

Unlike level-1 cache which cannot keep cache contents on reboot, level-2 cache is able to retain its cache contents across computer reboots because of the persistent nature of storage devices. Thus, PrimoCache can quickly provide needed data from level-2 cache and avoid fetching often-accessed data again from slow disks each time computer boots up. This will greatly improve the overall performance, reducing boot-up time and speeding up applications.

PrimoCache keeps track of use frequency for all data blocks in underlying slow disks. And when system is idle, PrimoCache will store high frequently used data blocks to level-2 cache. If system is busy, PrimoCache will postpone such store process in order not to slow down other Windows tasks. However, you can force PrimoCache to store data when Windows is busy by adjusting the value of the configuration parameter "Gather Interval". Refer to the L2Storage Write value listed in the statistics dialog to know how many bytes has been stored to level-2 cache since computer boots up. Later if a data block requested by system or applications can be found in level-2 cache, PrimoCache will directly read level-2 cache to get this data block. Check the L2Storage Read value to know how many bytes has been read from level-2 cache.

PrimoCache Level-2 CachePrimoCache Level-2 Cache Statistics Items

Before using level-2 cache, you have to create a level-2 storage volume first. A level-2 storage volume is a dedicated partition which is formatted to store cache index and content for level-2 cache. For more details on level-2 storage, see Manage Level-2 Storage.

By default, level-2 cache is set to cache read-data only to avoid writing too much to the level-2 storage device. If you want to use level-2 cache for write caching together with Defer-Write, you can change it following the steps below.
1. In the cache configuration dialog, click the Advanced L2 Cache Options button.
2. Uncheck the Individual Read/Write Cache Space option if you want the whole cache space shared for both reading and writing. Or, move the slider to specify a ratio of writing cache space if you want to separate reading and writing cache space.

PrimoCache Level-2 Reading/Writing Cache Ratio Setting

Potential Problem and Notice

Cache contents stored in level-2 storage are persistent even when storage devices are powered off. This brings up potential problems. For example, suppose that a level-2 storage volume was plugged out by intention or accident and some time later it is plugged in again, if source disk contents were modified during this period, cache contents may become outdated. In order to avoid such kind of problems, PrimoCache implements a mechanism to make sure that cache contents keep identical to source disks, by tracing and updating some Windows registry flags. When PrimoCache detects that cache contents are possibly outdated, it will remove all existing cache contents. This also means that Windows partition shall not be write-protected, otherwise PrimoCache cannot update registry flags and will think level-2 cache contents are outdated and remove them each time computer boots up. The same thing happens when Windows was abnormally shutdown due to crash, hang or power shutdown, because PrimoCache had no chance to update registry flags.

Though PrimoCache has the built-in verification mechanism as described above, it cannot prevent the case of "offline modification". "Offline modification" means that data in source disk or cache storage are modified when PrimoCache is not running. Given below is an example of "offline modification". Assume that you have two computers and a disk (here we call it X) was installed in one computer (here we call it A), you plugged out the disk X and installed it on the other computer and changed its contents, such as copying, overwriting, or deleting something to this disk. Then you installed the disk X back on the computer A. For the computer A, the disk X was "offline modified". Here is another example. Assume that you have a computer with dual-boot operating systems. If the disk X in one operating system (here we call it A) was modified in another operating system, then for the system A, the disk X was "offline modified". Because PrimoCache can do nothing when it is not running, it is the user's responsibility to avoid "offline modification".

Related Information