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

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


Ciprian,

> On Mar 8, 2019, at 2:15 PM, Ciprian Dorin Craciun <ciprian.craciun@gmail.=
com> wrote:
>=20
> On Fri, Mar 8, 2019 at 9:11 PM Mark Vitale <mvitale@sinenomine.net> wrote=
:
>> The -dcache option for a disk-based cache does set the number of dcaches=
 in memory.
>> It has a minimum value of 2000 and max of 10000.
>=20
>=20
> Is the 100K maximum a hard limit imposed in code, or a
> "best-practice"?  (I've looked in a few places and it seems that it is
> not a hard limit.)

Well, it's 10k, not 100k.  The limit is enforced by afsd; see src/afs/afsd.=
c routine afsd_run,
around line 2086:
2086         if (!sawDCacheSize) {
2087             dCacheSize =3D cacheFiles / 2;
2088             if (dCacheSize > 10000) {
2089                 dCacheSize =3D 10000;
2090             }
2091             if (dCacheSize < 2000) {
2092                 dCacheSize =3D 2000;
2093             }
2094             if (afsd_verbose)
2095                 printf("%s: dCacheSize autotuned to %d\n", rn, dCacheS=
ize);
2096         }

But now on more careful reading, I see this only applies when -dcache has n=
ot been explicitly specified.
(Which, to be fair, is the normal case).

> In addition, many of the options interact with each other.
>> The best guide for how all this _really_ works is the source code - howe=
ver, the
>> source itself is quite confusing at times, so I feel your pain.
>=20
>=20
> Currently I go with a trial-and-error approach.  :)
>=20
> (I'm struggling to get AFS to go over the 50MB/s, i.e. half a GigaBit,
> bandwidth...  My target is to saturate a full GigaBit link...)
>=20
> Thanks Mark for the info,
You're welcome.

Here are some helpful commands for examining the results of your configurat=
ion experiments:

cmdebug <client> -cache
fs getcacheparms -excessive

Regards,
--
Mark Vitale
mvitale@sinenomine.net