ArticleslgStudy

computer science

CacheFS

CacheFS is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand CacheFS rather than just read about it. In short: CacheFS is a family of software technologies designed to speed up distributed file system file access for networked computers. They store copies (caches) of files on secondary memory, typically a local hard disk, so that if a file is accessed again, it can be fetched locally at much higher speeds than networks typically allow.

CacheFS — main illustration
CacheFS — illustration

Key takeaways

  • CacheFS belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect CacheFS to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of CacheFS from memory before moving on to harder problems.

Reference excerpt

CacheFS is a family of software technologies designed to speed up distributed file system file access for networked computers. They store copies (caches) of files on secondary memory, typically a local hard disk, so that if a file is accessed again, it can be fetched locally at much higher speeds than networks typically allow. CacheFS software is used on several Unix-like operating systems. The original Unix version was developed by Sun Microsystems in 1993. Another version was written for Linux and released in 2003. Network filesystems are dependent on a network link and a remote server; obtaining a file from such a filesystem can be significantly slower than getting the file locally. For this reason, it can be desirable to cache data from these filesystems on a local disk, thus potentially speeding up future accesses to that data by avoiding the need to go to the network and fetch it again. The software has to check that the remote file has not changed since it was cached, but this is much faster than reading the whole file again.

Prior art Sprite used large disk block caches. These were located in main-memory to achieve high performance in its file system. The term CacheFS has found little or no use to describe caches in main memory.

Grossmont version The first CacheFS implementation, in 6502 assembler, was a write through cache developed by Mathew R Mathews at Grossmont College. It was used from fall 1986 to spring 1990 on three diskless 64 kB main memory Apple IIe computers to cache files from a Nestar file server onto Big Board, a 1 MB DRAM secondary memory device partitioned into CacheFS and TmpFS. The computers ran Pineapple DOS, an Apple DOS 3.3 derivative developed in the course of a follow on to WR Bornhorst's NSF funded Instructional Computing System. Pineapple DOS features, including caching, were unnamed; the name CacheFS was introduced seven years later by Sun Microsystems.

Sun version The first Unix CacheFS implementation was developed by Sun Microsystems and released in the Solaris 2.3 operating system release in 1993, as part of an expanded feature set for the NFS or Network File System suite known as Open Network Computing Plus (ONC+). It was subsequently used in other UNIX operating systems such as IRIX (starting with the 5.3 release in 1994).

Linux version Linux operating systems now commonly use a new version of CacheFS developed by David Howells. Howells appears to have rewritten CacheFS from scratch, not using Sun's original code. The Linux CacheFS currently is designed to operate on Andrew File System and Network File System (NFS) filesystems.

Terminology Because of its similar naming to FS-Cache, CacheFS' terminology is confusing to outsiders. CacheFS is a backend for FS-Cache and handles the actual data storage and retrieval. FS-Cache passes the requests from netfs to CacheFS.

FS-Cache The cache facility/layer between the cache backends just like CacheFS and NFS or AFS.

Cache backends

CacheFS CacheFS is a Filesystem for the FS-Cache facility. A block device can be used as cache by simply mounting it. Needs no special activation and is deactivated by unmounting it.

Cachefiles (daemon) Daemon using an existing filesystem (ext3 with user_xattr) as cache. Cache is bound with "cachefilesd -s".

Project status As of 2010, work on the project appeared to have stalled, and some people were attempting to revive the code and bring it up to date.

Features The facility can be conceptualized by the following diagram:

The facility (known as FS-Cache) is designed to be as transparent as possible to a user of the system. Applications should just be able to use NFS files as normal, without any knowledge of there being a cache.

See also Page cache

References

External links Fscache-ols2006 Presentation D.Howells@Red Hat Steve D.@Red Hat Red Hat CacheFS mailinglist Outdated articles?

LWN.NET A general caching filesystem LWN.NET Initial mail introducing cacheFS for Linux

Worked examples

Example 1 — a first encounter with CacheFS

Start with the simplest possible case. Write down what CacheFS claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to CacheFS before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about CacheFS ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of CacheFS

In research
CacheFS appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses CacheFS in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
CacheFS is common in secondary-school and first-year university syllabi. It links to neighbouring topics Network file systems, so understanding it makes those chapters shorter.
In everyday life
Look for CacheFS outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “CacheFS” →

How to study CacheFS in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what CacheFS means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain CacheFS out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is CacheFS in simple terms?

CacheFS is a family of software technologies designed to speed up distributed file system file access for networked computers. They store copies (caches) of files on secondary memory, typically a local hard disk, so that if a file is accessed again, it can be fetched locally at much higher speeds t…

Why does CacheFS matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study CacheFS?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on CacheFS.

Tags

  • Network file systems

Keep exploring