Re: [OpenAFS] AFS cache configuration

2018-04-17 Thread Kostas Liakakis



On 2018-04-16 18:16, Mark Vitale wrote:

[...]
You may find the following commands useful when tuning the cache:

cmdebug  -cache   # gives the current cache configuration

xstat_cm_test  2 -onceonly | head -n 35   # gives live cache 
statistics


Mark,

Thanks a lot for clearing this up, you really put me on track.

One more thing however, before I have a go at the cm configuration: 
regarding xstat_cm_test, what are {d,v}{local,remote}Accesses ? Do they 
correlate with cache hits somehow so one can infer the cache misses? For 
reference, here's what xstat_cm_test tells me:


Overall Performance Info:
-
     6 numPerfCalls
    1523004872 epoch
     1 numCellsVisible
     1 numCellsContacted
    1414893978 dlocalAccesses
     790563320 vlocalAccesses
        566088 dremoteAccesses
      3105 vremoteAccesses
     31250 cacheNumEntries
       100 cacheBlocksTotal
        536319 cacheBlocksInUse
       100 cacheBlocksOrig
       650 cacheMaxDirtyChunks
     0 cacheCurrDirtyChunks
    1415304535 dcacheHits
     790375884 vcacheHits

Thanks again,

-Kostas.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [OpenAFS] AFS cache configuration

2018-04-16 Thread Mark Vitale

> On Apr 16, 2018, at 5:19 AM, Kostas Liakakis  wrote:
> 
> I am running an OpenAFS 1.6.11 client against a set of 1.6.20 servers. I am 
> trying to find out if my client's cache is underutilized or thrashing because 
> if it running out of entries. I've read the documentation here ( 
> http://docs.openafs.org/Reference/5/afs_cache.html ) and the afsd page here ( 
> http://docs.openafs.org/Reference/8/afsd.html ) but I think I still don't 
> have the whole picture. So I'd like some help understanding the disk based 
> cache configuration.
> 
> My cache is configured via /etc/openafs/cacheinfo with 100 blocks (1GB) 
> of maximum space. afsd is started with -dynroot -fakestat -afsdb flags.
> 
> Now, what I read from the afsdb manual my chunksize by default should be 
> between, 256KB and 1MB. I can tell by looking at the Vn files in the cache 
> directory that chunksize is 1M, since there is no file greater than this size 
> while a few are more than 1023KB.
Yes, this is the correct default chunksize for a cache with 100 blocks - so 
far, so good.

> I also read that my Vn files number should by default be chosen as the 
> greater of (100, 100/10240, or 1.5*100/1024). The latter being the 
> greater I'd expect to find no more than 1464 Vn files in my cache directory. 
> Contrary to this, du --inodes says there are 31270 files in my cache 
> directory. Indeed, the highest numbered Vn file is V31249 and the rest of 
> used inodes can be attributed to parent directory entries.
This documentation is unfortunately outdated.   The number of files you ended 
up with is consistent with the number of blocks and chunksize (see source code 
in src/afs/afsd.c).

> So what am I missing here? How does the cache manager calculate the limit to 
> Vn files?
The algorithm in the 1.6.11 Unix cache manager (afsd) is (from afsd_run()):
...
2033 cacheFiles = cacheBlocks / 32;  /* Assume 32k avg filesize 
*/
You specified cacheBlocks 100, so this gives cacheFiles = 31250, the number 
you reported.
2034 
2035 cacheFiles = max(cacheFiles, 1000);
cacheFiles remains 31250
2036 
2037 /* Always allow more files than chunks.  Presume average V-file
2038  * is ~67% of a chunk...  (another guess, perhaps Honeyman will
2039  * have a grad student write a paper).  i is KILOBYTES.
2040  */
2041 i = 1 << (chunkSize < 10 ? 0 : chunkSize - 10);
Your chunksize was 20, so i=1<<(20-10)=1024
2042 cacheFiles = max(cacheFiles, 1.5 * (cacheBlocks / i));
1.5*(cacheBlocks 100/ i 1024) = 1464
so cacheFiles remains 31250.


You may find the following commands useful when tuning the cache:

cmdebug  -cache # gives the current cache configuration

xstat_cm_test  2 -onceonly | head -n 35 # gives live cache 
statistics

Regards,
--
Mark Vitale
mvit...@sinenomine.net



___
OpenAFS-info mailing list
OpenAFS-info@openafs.org
https://lists.openafs.org/mailman/listinfo/openafs-info


[OpenAFS] AFS cache configuration

2018-04-16 Thread Kostas Liakakis


Hello,

I am running an OpenAFS 1.6.11 client against a set of 1.6.20 servers. I 
am trying to find out if my client's cache is underutilized or thrashing 
because if it running out of entries. I've read the documentation here ( 
http://docs.openafs.org/Reference/5/afs_cache.html ) and the afsd page 
here ( http://docs.openafs.org/Reference/8/afsd.html ) but I think I 
still don't have the whole picture. So I'd like some help understanding 
the disk based cache configuration.


My cache is configured via /etc/openafs/cacheinfo with 100 blocks 
(1GB) of maximum space. afsd is started with -dynroot -fakestat -afsdb 
flags.


Now, what I read from the afsdb manual my chunksize by default should be 
between, 256KB and 1MB. I can tell by looking at the Vn files in the 
cache directory that chunksize is 1M, since there is no file greater 
than this size while a few are more than 1023KB.


I also read that my Vn files number should by default be chosen as the 
greater of (100, 100/10240, or 1.5*100/1024). The latter being 
the greater I'd expect to find no more than 1464 Vn files in my cache 
directory. Contrary to this, du --inodes says there are 31270 files in 
my cache directory. Indeed, the highest numbered Vn file is V31249 and 
the rest of used inodes can be attributed to parent directory entries.


So what am I missing here? How does the cache manager calculate the 
limit to Vn files?


Thanks in advance,

-Kostas.



smime.p7s
Description: S/MIME Cryptographic Signature