[OpenAFS] Questions regarding `afsd` caching arguments (`-dcache` and `-files`)

Mark Vitale mvitale@sinenomine.net
Fri, 8 Mar 2019 19:11:53 +0000

> On Mar 8, 2019, at 11:19 AM, Ciprian Dorin Craciun <ciprian.craciun@gmail=
.com> wrote:
> I have two small questions about the cache management of `asfd`.  (The
> documentation isn't very explicit.)
> (In both cases I'm speaking about disk-based cache.)
> (A) Using `-dcache 128` with a `-chunksize 10` (i.e. 1MiB) for a
> disk-based cache, would actually allocate 128 MiB from kernel memory
> (i.e. the product of the two)?  It is unclear from the documentation.
> (Although I would infer yes, based on the description of memory based
> cache.)

As you've already discovered, the documentation is problematic for the afsd=
The -dcache option for a disk-based cache does set the number of dcaches in=
It has a minimum value of 2000 and max of 10000.=20
(The documentation incorrectly states that 2000 is the max).
However, it does not allocate chunks, but dcache structs, which are 220 byt=
es each.

In addition, many of the options interact with each other.
The best guide for how all this _really_ works is the source code - however=
, the
source itself is quite confusing at times, so I feel your pain.

> (B)  Using `-files` and `-chunksize` so that their product is larger
> than `-blocks` means that the cache can hold up to as many `-files`
> actual AFS files, but their total size can't be larger than `-blocks`?
> (I.e. if one has a cell with lots of small files, it is OK to
> configure a largish `-chunksize` and `-files` because they will be
> cached up to `-blocks`.)


Mark Vitale