Page 1 of 1

Read caching

Posted: Wed Sep 21, 2011 12:01 pm
by robnicholson
The caching options on a target both refer to write caching (write-through and write-back). If you have no caching selected, does StarWind do read caching by default? If so, how do you control how much space is used for caching? We've got a lovely 12-core 16GB PowerEdge SAN and it's only using 1.6GB out of that 16GB. I kind of expected StarWind to use as much memory for a read cache.

Am I'm missing something?

Cheers, Rob.

Re: Read caching

Posted: Wed Sep 21, 2011 1:10 pm
by anton (staff)
There's no dedicated "read" or "write" cache. It's all the same. So if you did not enable it - there no cache for both reads and writes.
robnicholson wrote:The caching options on a target both refer to write caching (write-through and write-back). If you have no caching selected, does StarWind do read caching by default? If so, how do you control how much space is used for caching? We've got a lovely 12-core 16GB PowerEdge SAN and it's only using 1.6GB out of that 16GB. I kind of expected StarWind to use as much memory for a read cache.

Am I'm missing something?

Cheers, Rob.

Re: Read caching

Posted: Wed Sep 21, 2011 2:14 pm
by robnicholson
So you cannot have read caching without enabling write caching?

Cheers, Rob.

Re: Read caching

Posted: Thu Sep 22, 2011 8:51 am
by anton (staff)
You can. It's called Write-Through cache mode. Pretty close to what you want.
robnicholson wrote:So you cannot have read caching without enabling write caching?

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 2:37 pm
by robnicholson
But is the write-through cache only filled during writes? So if you read the same block 1,000 times but never write it, is it not cached and the same block is read 1,000 times from the disk file?

I know that Windows itself will probably cache the read.

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 2:44 pm
by anton (staff)
Nope. We do cache reads just fine.

Windows caching does not work for virtual storage. Long story why but if somebody has no own cache implementation and uses Windows built-in cache he does WRONG.
robnicholson wrote:But is the write-through cache only filled during writes? So if you read the same block 1,000 times but never write it, is it not cached and the same block is read 1,000 times from the disk file?

I know that Windows itself will probably cache the read.

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 3:01 pm
by robnicholson
Nope. We do cache reads just fine.
Hate to appear dumb here but how therefore do you control the size of the read cache?

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 3:01 pm
by robnicholson
And the reason I'm asking is that we've got 16GB of memory in our SAN but there is 14GB free. Doesn't sound like StarWind is using it as a read cache?

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 3:09 pm
by anton (staff)
If you did not read anything or did not configure StarWind to use RAM as a cache then of course memory would be free :)
robnicholson wrote:And the reason I'm asking is that we've got 16GB of memory in our SAN but there is 14GB free. Doesn't sound like StarWind is using it as a read cache?

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 5:19 pm
by robnicholson
I'm obviously not explaining myself very well here. StarWind has three options:

1. No cache
2. Write-through
3. Write-back

If you configure a 1GB write-through cache but only read from the disk, does StarWind use the 1GB write-through cache during read?

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 8:31 pm
by anton (staff)
Yes, read caching is the same for all cache enabled modes.

Re: Read caching

Posted: Wed Oct 12, 2011 8:37 pm
by robnicholson
So in general for performance reasons you should always use "Write-through" caching as a minimum? In what circumstance would you not use caching at all?

Cheers, Rob.

Re: Read caching

Posted: Wed Oct 12, 2011 8:46 pm
by anton (staff)
Ability to disable caching is mandatory for any type of storage. You should not disable write-back cache with HA config unless you know what you're doing.
robnicholson wrote:So in general for performance reasons you should always use "Write-through" caching as a minimum? In what circumstance would you not use caching at all?

Cheers, Rob.

Re: Read caching

Posted: Thu Oct 13, 2011 11:10 am
by Alex (staff)
We are using the following cache filling strategy for read operations:
When the data has been read from disk, cache is checking if it has available blocks.
If it can allocate new data block or can use an existing block that is not dirty, new data is being copied to cache.
If there are no blocks available (all blocks are dirty and cache size does not allow to allocate new one), than result of read operation is not being cached. This allows to not slow down the client with flushing dirty blocks.

When the cache block is accessed on read or write operation, it is being shifted in LRU queue.

Write thorough caching keeps all data blocks not dirty, because data is being flushed to disk immediately.
So, write-through cache is filled in depending on the frequency the data block is accessed, independently on the type of operation – read or write.