Read caching

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Sep 21, 2011 12:01 pm

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.
User avatar
anton (staff)
Site Admin
Posts: 4021
Joined: Fri Jun 18, 2004 12:03 am
Location: British Virgin Islands
Contact:

Wed Sep 21, 2011 1:10 pm

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.
Regards,
Anton Kolomyeytsev

Chief Technology Officer & Chief Architect, StarWind Software

Image
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Sep 21, 2011 2:14 pm

So you cannot have read caching without enabling write caching?

Cheers, Rob.
User avatar
anton (staff)
Site Admin
Posts: 4021
Joined: Fri Jun 18, 2004 12:03 am
Location: British Virgin Islands
Contact:

Thu Sep 22, 2011 8:51 am

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.
Regards,
Anton Kolomyeytsev

Chief Technology Officer & Chief Architect, StarWind Software

Image
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Oct 12, 2011 2:37 pm

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.
User avatar
anton (staff)
Site Admin
Posts: 4021
Joined: Fri Jun 18, 2004 12:03 am
Location: British Virgin Islands
Contact:

Wed Oct 12, 2011 2:44 pm

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.
Regards,
Anton Kolomyeytsev

Chief Technology Officer & Chief Architect, StarWind Software

Image
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Oct 12, 2011 3:01 pm

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.
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Oct 12, 2011 3:01 pm

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.
User avatar
anton (staff)
Site Admin
Posts: 4021
Joined: Fri Jun 18, 2004 12:03 am
Location: British Virgin Islands
Contact:

Wed Oct 12, 2011 3:09 pm

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.
Regards,
Anton Kolomyeytsev

Chief Technology Officer & Chief Architect, StarWind Software

Image
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Oct 12, 2011 5:19 pm

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.
User avatar
anton (staff)
Site Admin
Posts: 4021
Joined: Fri Jun 18, 2004 12:03 am
Location: British Virgin Islands
Contact:

Wed Oct 12, 2011 8:31 pm

Yes, read caching is the same for all cache enabled modes.
Regards,
Anton Kolomyeytsev

Chief Technology Officer & Chief Architect, StarWind Software

Image
robnicholson
Posts: 359
Joined: Thu Apr 14, 2011 3:12 pm

Wed Oct 12, 2011 8:37 pm

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.
User avatar
anton (staff)
Site Admin
Posts: 4021
Joined: Fri Jun 18, 2004 12:03 am
Location: British Virgin Islands
Contact:

Wed Oct 12, 2011 8:46 pm

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.
Regards,
Anton Kolomyeytsev

Chief Technology Officer & Chief Architect, StarWind Software

Image
User avatar
Alex (staff)
Staff
Posts: 177
Joined: Sat Jun 26, 2004 8:49 am

Thu Oct 13, 2011 11:10 am

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.
Best regards,
Alexey.
Post Reply