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

来源:https://www.cnblogs.com/xuyaowen/archive/2019/12/03/fscache-and-cachefs.html
-Advertisement-
Play Games

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.

原文鏈接:https://arvimal.blog/2014/09/14/fs-cache-and-cachefs-what-are-the-differences/ 

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


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 一 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: 檢查是否刪除完成: [root@localhost ~]# java -version-bash: java: 未找 ...
  • 剛開始使用Ubuntu 18.04,這裡記錄下我用過的快捷鍵。 1、Super鍵:打開活動搜索界面 這個鍵就是win鍵,註意起作用的是鍵盤左邊的那個win鍵,右邊的無效(後面的快捷鍵中左右都有效)。此鍵按下後會出現一個搜索視窗,可以搜索想要的應用程式。此外還顯示正在運行的GUI應用程式以及工作區。 ...
  • ![](https://img2018.cnblogs.com/blog/1452965/201912/1452965-20191203120625575-897994852.png) ...
一周排行
    -Advertisement-
    Play Games
  • Dapr Outbox 是1.12中的功能。 本文只介紹Dapr Outbox 執行流程,Dapr Outbox基本用法請閱讀官方文檔 。本文中appID=order-processor,topic=orders 本文前提知識:熟悉Dapr狀態管理、Dapr發佈訂閱和Outbox 模式。 Outbo ...
  • 引言 在前幾章我們深度講解了單元測試和集成測試的基礎知識,這一章我們來講解一下代碼覆蓋率,代碼覆蓋率是單元測試運行的度量值,覆蓋率通常以百分比表示,用於衡量代碼被測試覆蓋的程度,幫助開發人員評估測試用例的質量和代碼的健壯性。常見的覆蓋率包括語句覆蓋率(Line Coverage)、分支覆蓋率(Bra ...
  • 前言 本文介紹瞭如何使用S7.NET庫實現對西門子PLC DB塊數據的讀寫,記錄了使用電腦模擬,模擬PLC,自至完成測試的詳細流程,並重點介紹了在這個過程中的易錯點,供參考。 用到的軟體: 1.Windows環境下鏈路層網路訪問的行業標準工具(WinPcap_4_1_3.exe)下載鏈接:http ...
  • 從依賴倒置原則(Dependency Inversion Principle, DIP)到控制反轉(Inversion of Control, IoC)再到依賴註入(Dependency Injection, DI)的演進過程,我們可以理解為一種逐步抽象和解耦的設計思想。這種思想在C#等面向對象的編 ...
  • 關於Python中的私有屬性和私有方法 Python對於類的成員沒有嚴格的訪問控制限制,這與其他面相對對象語言有區別。關於私有屬性和私有方法,有如下要點: 1、通常我們約定,兩個下劃線開頭的屬性是私有的(private)。其他為公共的(public); 2、類內部可以訪問私有屬性(方法); 3、類外 ...
  • C++ 訪問說明符 訪問說明符是 C++ 中控制類成員(屬性和方法)可訪問性的關鍵字。它們用於封裝類數據並保護其免受意外修改或濫用。 三種訪問說明符: public:允許從類外部的任何地方訪問成員。 private:僅允許在類內部訪問成員。 protected:允許在類內部及其派生類中訪問成員。 示 ...
  • 寫這個隨筆說一下C++的static_cast和dynamic_cast用在子類與父類的指針轉換時的一些事宜。首先,【static_cast,dynamic_cast】【父類指針,子類指針】,兩兩一組,共有4種組合:用 static_cast 父類轉子類、用 static_cast 子類轉父類、使用 ...
  • /******************************************************************************************************** * * * 設計雙向鏈表的介面 * * * * Copyright (c) 2023-2 ...
  • 相信接觸過spring做開發的小伙伴們一定使用過@ComponentScan註解 @ComponentScan("com.wangm.lifecycle") public class AppConfig { } @ComponentScan指定basePackage,將包下的類按照一定規則註冊成Be ...
  • 操作系統 :CentOS 7.6_x64 opensips版本: 2.4.9 python版本:2.7.5 python作為腳本語言,使用起來很方便,查了下opensips的文檔,支持使用python腳本寫邏輯代碼。今天整理下CentOS7環境下opensips2.4.9的python模塊筆記及使用 ...