FS-Cache和CacheFS 有什麼不同嗎?(轉載)


FS-Cache and CacheFS. Are there any differences between these two? Initially, I thought both were same. But no, it’s not. CacheFS is the backend imple ...

FS-Cache and CacheFS. Are there any differences between these two? Initially, I thought both were same. But no, it’s not.

CacheFS is the backend implementation which caches the data onto the disk and mainpulates it, while FS-Cache is an interface which talks to CacheFS.

So why do we need two levels here?

FS-Cache was introduced as an API or front-end for CacheFS, which can be used by any file system driver. The file system driver talks with the FS-Cache API which inturn talks with CacheFS in the back-end. Hence, FS-Cache acts as a common interface for the file system drivers without the need to understand the backend CacheFS complexities, and how its implemented.

The only drawback is the additional code that needs to go into each file system driver which needs to use FS-Cache. ie.. Every file system driver that needs to talk with FS-Cache, has to be patched with the support to do so. Moreover, the cache structure differs slightly between file systems using it, and thus lacks a standard. This unfortunately, prevents FS-Cache from being used by every network filesystem out there.

The data flow would be as:

VFS <-> File system driver (NFS/CIFS etc..) <-> FS-Cache <-> CacheFS <-> Cached data

CacheFS need not cache every file in its entirety, it can also cache files partially. This partial caching mechanism is possible since FS-Cache caches ‘pages’ rather than an entire file. Pages are smaller fixed-size segments of data, and these are cached depending on how much the files are read initially.

FS-Cache does not require an open file to be loaded in the cache, prior being accessed. This is a nice feature as far as I understand, and the reasons are:

a) Not every open file in the remote file system can be loaded into cache, due to size limits. In such a case, only certain parts (pages) may be loaded. And the rest of the file should be accessed normally over the network.

b) The cache won’t necessarily be large enough to hold all the open files on the remote system.

c) Even if the cache is not populated properly, the file should be accessible. ie.. the cache should be able to be bypassed totally.

This hopefully clears the differences between FS-Cache and CacheFS.


保持更新,更多內容請關註 cnblogs.com/xuyaowen;


  • 一 Kubernetes DNS介紹1.1 Kubernetes DNS發展作為服務發現機制的基本功能,在集群內需要能夠通過服務名對服務進行訪問,因此需要一個集群範圍內的DNS服務來完成從服務名到ClusterIP的解析。DNS服務在Kubernetes的發展過程中經歷了3個階段,SkyDNS --... ...
  • 一 前言 幾大RPC框架介紹 1.支持多語言的RPC框架,google的gRPC,Apache(facebook)的Thrift 2.只支持特定語言的RPC框架,例如新浪的Motan 3.支持服務治理等服務化特性的分散式框架,例如阿裡的dubbo 4.擁有完整生態的spring cloud spri ...
  • 操作系統:macOs High Sierra 10.13.6 1.我用的homebrew安裝的nignx1.15.9,安裝完成之後會有下麵的提示: 網站根目錄在:/usr/local/var/www nginx配置文件位置:/usr/local/etc/nginx 註意:nginx被安裝到的目錄位置 ...
  • 問題描述:生產環境中需要經常運用NFS掛載,就在測試環境中測試一下,將伺服器中192.168.1.4 /u01/app/oracle/product/11.2.0/dbhome_1/dbs 掛載到192.168.1.3的/nfs/nfs_orcl, 將192.168.1.5/u01/app/orac ...
  • 這裡僅介紹我在Ubuntu 18.04下用到的工具軟體,都是正版免費的。 1、Office辦公套件 Ubuntu 18.04預設安裝後會提供LibreOffice辦公套件,功能還是可以的,但這裡推薦使用國產的WPS。WPS官方提供了免費的Linux版下載,下載地址:WPS Linux版本。初次使用W ...
  • 一、卸載自帶OpenJDK 一些Linux系統會自帶一個OpenJDK,在安裝OracleJDK之前,先卸載掉自帶的OpenJDK: 查找已經安裝的JDK組件: 刪除OpenJDK: 檢查是否刪除完成: [[email protected] ~]# java -version-bash: java: 未找 ...
  • 剛開始使用Ubuntu 18.04,這裡記錄下我用過的快捷鍵。 1、Super鍵:打開活動搜索界面 這個鍵就是win鍵,註意起作用的是鍵盤左邊的那個win鍵,右邊的無效(後面的快捷鍵中左右都有效)。此鍵按下後會出現一個搜索視窗,可以搜索想要的應用程式。此外還顯示正在運行的GUI應用程式以及工作區。 ...
  • ![](https://img2018.cnblogs.com/blog/1452965/201912/1452965-20191203120625575-897994852.png) ...