Flushing L1 and L2 cache to single HDD

FAQ, getting help, user experience about PrimoCache
Post Reply
mell111
Level 5
Level 5
Posts: 48
Joined: Fri Oct 05, 2018 11:16 am

Flushing L1 and L2 cache to single HDD

Post by mell111 »

As I recall from a previous post, Support said that L1 cache is written directly to the associated HDD (without going through L2 first.)

If I'm recalling correctly, with a setup of an L1 and L2 cache associated with a single HDD, what happens when PrimoCache is ready to flush both?

Will it write the data from both L1 and L2 at the same time (which would of course cause more HDD seeking and would considerably slow down writing) or will it hold off flushing one cache until it's done flushing the other?

If it holds off, what happens when the "waiting" cache fills up and there is an app still writing? If not, what happens when the associated HDD seeking is slowing down writing such that both L1 and L2 fill up?

Thanks.
User avatar
Jaga
Contributor
Contributor
Posts: 692
Joined: Sat Jan 25, 2014 1:11 am

Re: Flushing L1 and L2 cache to single HDD

Post by Jaga »

Typically operations involving read/write are handled sequentially to volumes in a single cache task. This is most easily seen when using multiple volumes and turning on the boot at prefetch feature for the L1. It will step through each disk one at a time, preloading content into the L1.

I fully suspect the write flush algorithm for a cache task is similar for the L1 + L2. If there's no need for urgent writes (see next paragraph) it probably handles the L1 first then the L2, simply because L1 is a higher priority cache, and isn't as large as the L2. You wouldn't want write contention between the L1 and L2 - Romex is usually pretty good about this sort of thing.

If the L1 (or L2) fills up with more writes coming in we enter into "urgent writes" territory, and requests to write to disk -can- circumvent the cache completely. This is most easily seen by turning on write cache on the L1, then copying a file much larger than the L1 to the disk it is caching.

Note that my thoughts on L1 + L2 write flushing order are speculation based on observation, and I think only Support can give specifics. What would be nice when using both L1 and L2 as write caches however, is if the L1 "passed on" urgent write requests to the L2 (instead of the cached volume) when it was full and more writes were coming in. It would help to sustain write speeds with larger transactions.
mell111
Level 5
Level 5
Posts: 48
Joined: Fri Oct 05, 2018 11:16 am

Re: Flushing L1 and L2 cache to single HDD

Post by mell111 »

Thanks, Jaga. That makes sense. Hopefully Support will weigh in.
User avatar
Support
Support Team
Support Team
Posts: 3627
Joined: Sun Dec 21, 2008 2:42 am

Re: Flushing L1 and L2 cache to single HDD

Post by Support »

Conceptually, "flush" means that all "dirty" data in the cache (L1 + L2) are requested to be written to target disks. So dirty data in L1 cache will be directly written to disk instead of to L2-then-disk. There is no fixed flush order between L1 and L2. PrimoCache has a dedicated algorithm to handle the flush request and might do dynamic tuning.
Jaga wrote: Mon Oct 22, 2018 7:54 pm What would be nice when using both L1 and L2 as write caches however, is if the L1 "passed on" urgent write requests to the L2 (instead of the cached volume) when it was full and more writes were coming in. It would help to sustain write speeds with larger transactions.
When L1 cache is in "Urgent Write" mode, PrimoCache will cache incoming write-data to L2 and meanwhile L1 writes data to disk. This is designed exactly for heavy write-load scenarios to fully utilize the abilities of L2 disk and target disk. In this way, L2 disk and target disk can process write requests independently and simultaneously, obviously resulting to the best write performance.
However, some users do not want target disks to be written when L2 still has spare space. We do think to provide another write mode as you described.
Post Reply