none
Disk Caching with SMB File Share RRS feed

  • Question

  • Hi There,

    I have a quick question which is hopefully obvious to someone in the know! What kinds of write caching is used  when writing from a client PC to an SMB file share on a server?

    Say for example I:

    -Loaded a Zip file stored on a remote SMB share
    -Added a file to the Zip manifest
    -Save changes back to the SMB

    Presumably when I load the Zip this creates a temporary copy on my local system and When I add a new file to the archive this modifies the temporary copy on my local drive which is subject to my local disk write cache?

    Then when I save the Zip back this triggers the remote server to perform a write to the local disk using the data my client provides and this write is subject to the disk write cache on the remote server?

    Is that correct? Does the SMB protocol trigger a flush of the local disk cache before it begins writing to the server?

    I know Windows SMB stores a kind of local cache too on the client but does this cache effect writes to the remote server or does it function more like a RAID 1 with data written to both the local cache and the remote server in parallel?

    Any information would be much appreciated.

    Thanks,

    Olly


    Olly

    Monday, January 11, 2016 11:36 AM

Answers

  • Hi There,

    I have a quick question which is hopefully obvious to someone in the know! What kinds of write caching is used  when writing from a client PC to an SMB file share on a server?

    Say for example I:

    -Loaded a Zip file stored on a remote SMB share
    -Added a file to the Zip manifest
    -Save changes back to the SMB

    Presumably when I load the Zip this creates a temporary copy on my local system and When I add a new file to the archive this modifies the temporary copy on my local drive which is subject to my local disk write cache?

    Then when I save the Zip back this triggers the remote server to perform a write to the local disk using the data my client provides and this write is subject to the disk write cache on the remote server?

    Is that correct? Does the SMB protocol trigger a flush of the local disk cache before it begins writing to the server?

    I know Windows SMB stores a kind of local cache too on the client but does this cache effect writes to the remote server or does it function more like a RAID 1 with data written to both the local cache and the remote server in parallel?

    Any information would be much appreciated.

    [ ... ]

    It depends on the mode SMB3 share is configured (Continuously Available Vs non-CA) and file handle mode opened (file can be opened with local cache, w/out local cache and w/out any cache at all). Good reading here:

    To scale or not to scale?

    http://blogs.technet.com/b/filecab/archive/2013/12/05/to-scale-out-or-not-to-scale-out-that-is-the-question.aspx

    Normally for non-CA share and all-cache mode you'll get LOCAL cache on your mini redirector driver and also file system cache on server (Cache & Memory Manager cache within monolithic file system driver, NTFS or ReFS or FASTFAT) and some (optional) flash cache @ Storage Spaces layer (WBC). Clustered configuration and read sequence will also add read-only CVS cache ;)

    How to enable CSV Cache?

    http://blogs.msdn.com/b/clustering/archive/2013/07/19/10286676.aspx

    Storage Spaces WB Cache

    https://msdn.microsoft.com/en-us/library/windows/hardware/dn567634(v=vs.85).aspx

    Hope this helped :)

    P.S. Storage Spaces Direct will add more cache layers. Both RAM & flash.

    P.P.S. Deduplication filter on NTFS also has dedupe cache in memory so if you have dedupe enabled on NTFS you'll have one more extra layer of caching ;)



    Cheers,

    Anton Kolomyeytsev [MVP]

    StarWind Software Chief Architect

    Profile:   Blog:   Twitter:   LinkedIn:  

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    • Marked as answer by O11y Monday, January 11, 2016 6:49 PM
    Monday, January 11, 2016 4:49 PM

All replies

  • Hi There,

    I have a quick question which is hopefully obvious to someone in the know! What kinds of write caching is used  when writing from a client PC to an SMB file share on a server?

    Say for example I:

    -Loaded a Zip file stored on a remote SMB share
    -Added a file to the Zip manifest
    -Save changes back to the SMB

    Presumably when I load the Zip this creates a temporary copy on my local system and When I add a new file to the archive this modifies the temporary copy on my local drive which is subject to my local disk write cache?

    Then when I save the Zip back this triggers the remote server to perform a write to the local disk using the data my client provides and this write is subject to the disk write cache on the remote server?

    Is that correct? Does the SMB protocol trigger a flush of the local disk cache before it begins writing to the server?

    I know Windows SMB stores a kind of local cache too on the client but does this cache effect writes to the remote server or does it function more like a RAID 1 with data written to both the local cache and the remote server in parallel?

    Any information would be much appreciated.

    [ ... ]

    It depends on the mode SMB3 share is configured (Continuously Available Vs non-CA) and file handle mode opened (file can be opened with local cache, w/out local cache and w/out any cache at all). Good reading here:

    To scale or not to scale?

    http://blogs.technet.com/b/filecab/archive/2013/12/05/to-scale-out-or-not-to-scale-out-that-is-the-question.aspx

    Normally for non-CA share and all-cache mode you'll get LOCAL cache on your mini redirector driver and also file system cache on server (Cache & Memory Manager cache within monolithic file system driver, NTFS or ReFS or FASTFAT) and some (optional) flash cache @ Storage Spaces layer (WBC). Clustered configuration and read sequence will also add read-only CVS cache ;)

    How to enable CSV Cache?

    http://blogs.msdn.com/b/clustering/archive/2013/07/19/10286676.aspx

    Storage Spaces WB Cache

    https://msdn.microsoft.com/en-us/library/windows/hardware/dn567634(v=vs.85).aspx

    Hope this helped :)

    P.S. Storage Spaces Direct will add more cache layers. Both RAM & flash.

    P.P.S. Deduplication filter on NTFS also has dedupe cache in memory so if you have dedupe enabled on NTFS you'll have one more extra layer of caching ;)



    Cheers,

    Anton Kolomyeytsev [MVP]

    StarWind Software Chief Architect

    Profile:   Blog:   Twitter:   LinkedIn:  

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    • Marked as answer by O11y Monday, January 11, 2016 6:49 PM
    Monday, January 11, 2016 4:49 PM
  • Anton, this answer was above and beyond what I was hoping for. Thank you very much Sir

    Olly

    Monday, January 11, 2016 6:49 PM
  • Anton, this answer was above and beyond what I was hoping for. Thank you very much Sir
    Olly you're welcomed! Ping me privately if you'd have any Windows architecture related questions you'll be shy to ask on public forums. I *may* help answering some of those ;) Good luck!

    Cheers,

    Anton Kolomyeytsev [MVP]

    StarWind Software Chief Architect

    Profile:   Blog:   Twitter:   LinkedIn:  

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    Tuesday, January 12, 2016 10:10 AM