PrimoCache >> Online Help >> Terms >>

Level-2 Cache

This topic 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 Cache
PrimoCache Level-2 Cache Statistics Items

For better performance, level-2 cache is designed to store read-data only. For example, if a file is written to disk, this file will not be stored into level-2 cache. However, if later system reads this file from disk, this file will be cached into level-2 storage.

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.

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".

In versions prior to v2.0.0, an issue might be observed on few computers when using level-2 cache. On these computers, PrimoCache almost does not store data to level-2 cache and L2Storage Write value increases very slowly. This issue is usually caused by corruption of Windows performance counters. Open Control Panel, double-click Administrative Tools, and then click Performance. You'll probably see a warning message like the figure below.

Performance Counter Error Message

If such warning message pops up, you shall fix it first by using the lodctr /r command. See lodctr for more details.

Reference