[751] in testers
AFS cache size is too large
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue May 15 17:34:05 1990
From: akagerry@ATHENA.MIT.EDU
Date: Tue, 15 May 90 17:33:21 -0400
To: testers@ATHENA.MIT.EDU
I filled up my /site partition today. As it turns out it was because
my AFS cache size was set to be larger than my /site partition. I
track it to the follow code from /etc/rc:
if [ \( "${AFSADJUST}" = "true" -o "${PUBLIC}" = "true" \) \
-a -d /usr/vice/cache/ ]; then
echo -n "Adjusting the cache size..." >/dev/console
rm -f /usr/vice/etc/cacheinfo.old
mv -f /usr/vice/etc/cacheinfo /usr/vice/etc/cacheinfo.old
( /bin/echo ${PUBLIC} ; \
/bin/df /usr/vice/cache/ ; \
/bin/du -s /usr/vice/cache/) | \
/bin/awk ' \
(NR == 1) { if ($1=="true") { y=1 } else { y=0 } } \
(NR == 3) { free = $4 + ($3 * y); } \
(NR == 4) { x = int((free+$1-3000)*3/4); \
if (x < 2000) { x = 2000 } ; \
if (x > 40000) { x = 40000 } ; \
printf("/afs:/usr/vice/cache:%d\n",x);}' \
> /usr/vice/etc/cacheinfo
If I understand this correctly, the formulas as stated above is.
(which considering my knowledge of 'awk' should not be taken for
granted)
If ($PUBLIC == true)
free = avialable_disk_space + used_disk_space
else
free = available_disk_space
x = (free + current_amount_in_cache - 3000) * 3/4
if (x < 2000)
x = 2000
if (x > 40000)
x = 40000
cachesize = x
ENGLISH TRANSLATION:
The value of x is proportional to the current amount of file space
used in the cache. Thus with a new workstation with an empty cache
the size get's set to ~3/4 of the site partition. As the cache fills
up each time the machine reboots the cache size will get set a little
bit larger.
--Jerry