How does write-back cache work?

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

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

Post Reply
danswartz
Posts: 71
Joined: Fri May 03, 2019 7:21 pm

Mon Nov 25, 2019 4:57 pm

I'm curious about this. If a write comes in from an iSCSI client, is it acked right away? If so, what happens if the synch link goes down before it gets written, and this is the node that is demoted (e.g. no long visible to vsphere?) Wouldn't that expose you to lost write(s)? Or is the write not acked until it has been sent over the synch link to the other node, and has been acknowledged as received there, even if the other node hasn't written it yet?
yaroslav (staff)
Staff
Posts: 2278
Joined: Mon Nov 18, 2019 11:11 am

Wed Nov 27, 2019 11:37 am

Data is acked to be written only if written to the underlying storage.
Should the Sync link go down, both servers are to decide which one is to stop serving client writes; writing to the node that has lower synchronization priority will be stopped afterward. That's how VSAN helps to avoid split-brain with Heartbeat.
If there's no sync link, no acknowledgment comes from the partner node. Small note: If both nodes are active and synchonized, clients cannot get an acknowledge package until data is confirmed to be safely written to the partner host.
If you demote the node from vCenter (without shutting it down) everything you have in server's RAM should stay there. Once you unplug or reboot that host, data is lost. That's how non-persistent memory works.
Here’s how L1 cache works in StarWind VSAN: https://knowledgebase.starwindsoftware. ... rinciples/
asherxo
Posts: 2
Joined: Mon Aug 24, 2020 3:45 am

Mon Aug 24, 2020 9:45 am

Thanks for the detailed explanation yaroslav
Last edited by asherxo on Thu Sep 03, 2020 3:32 pm, edited 1 time in total.
yaroslav (staff)
Staff
Posts: 2278
Joined: Mon Nov 18, 2019 11:11 am

Mon Aug 24, 2020 10:15 am

You are always welcome :)
richardcharles
Posts: 1
Joined: Sun Jul 15, 2018 2:29 pm
Contact:

Wed Sep 23, 2020 6:22 am

Hi all,

I have a standalone win2018 with a parity accelerated volume.

As I can understand, in the faster ssd storage tiers we have the most frequent accessed files.

But what about the write back cache? What kind of data will go through the WBC? Block or files?

Thanks in advance
yaroslav (staff)
Staff
Posts: 2278
Joined: Mon Nov 18, 2019 11:11 am

Wed Sep 23, 2020 7:06 am

Greetings,

Win2018, there is no such a WS :) Is it 2019?
Blocks are cached. Learn more about Write-Back Cache implementation at https://knowledgebase.starwindsoftware. ... principles.
boby
Posts: 1
Joined: Sat Dec 15, 2018 11:04 am

Sun Sep 27, 2020 11:37 am

Hi,

I have a question about what cache type everyone is using on their VMs in production. We are using standalone hardware nodes all SSD disks with hardware (Perc) RAID RAID-5. The chosen cache type for both Windows VMs and Linux VMs is write back for optimal performance.

We've found a lot of mixed opinions on the safety of using write back cache. It's said to be potentially dangerous in a power failure. Are the dangers of power failure / unclean shutdown only at hardware level or is write-back dangerous in unclean shutdowns / poweroffs at VM level too?

What is the ideal caching in our scenario to achieve an ideal performance vs safety trade off?

Thanks
batiati
Posts: 29
Joined: Mon Apr 08, 2019 1:16 pm
Location: Brazil
Contact:

Mon Sep 28, 2020 2:06 am

boby wrote:Are the dangers of power failure / unclean shutdown only at hardware level or is write-back dangerous in unclean shutdowns / poweroffs at VM level too
Write-back cache is dangerous when all hosts are unexpectedly shut down at the same time. At the VM level, unexpected shutdowns always have potentially hazardous effects over the file system.
boby wrote: What is the ideal caching in our scenario to achieve an ideal performance vs safety trade off?
Best safety option: write-through cache, only reads are cached;
Good safety option: write-back with redundant power supply and independent UPS system for each vSAN host.
yaroslav (staff)
Staff
Posts: 2278
Joined: Mon Nov 18, 2019 11:11 am

Mon Sep 28, 2020 7:50 am

Hey batiati,

You are right. Thanks for helping.
jamesjohn
Posts: 1
Joined: Sat Sep 15, 2018 8:15 am
Contact:

Tue Sep 29, 2020 7:34 am

Hi there,

I’m going to put a more RAM soon to my servers, I was thinking to use a few GB of RAM to creade ramdisk as writeback cashe for my SN (8TB snr disc). Yes I do have very reliable backup power supply and RAM memory is ECC.

Does any one of you have any experience with writeback cache as a ramdisk? Any recommendation?
yaroslav (staff)
Staff
Posts: 2278
Joined: Mon Nov 18, 2019 11:11 am

Tue Sep 29, 2020 4:18 pm

Greetings,

StarWind enables to create a RAM disk device that can be used as a superfast device for testing purposes. Learn more at https://www.starwindsoftware.com/help/R ... evice.html
Post Reply