[plug] smbfs caching

ryan at is.as.geeky.as ryan at is.as.geeky.as
Fri Dec 13 12:55:14 WST 2002


Had a strange thing happen just now copying files around our WAN that I
didn't understand at the time and hadn't seen before.

<--- start of historical naivety ---------------------------->

We have a 25 Kbyte/s PVC between 2 sites.  End A has an NT machine, end
B has a Linux machine (Debian - 2.4.18).  I mounted an NT share from end
A onto the Linux machine at end B: mount -t smbfs //10.1.0.3/share
/mnt/endA

I then went onto a Windows machine at end B and connected to a Samba
share on the end B Linux box, browsed to the end A mount and copied the
entire share to the local Windows machine (9MB - took around 6 minutes -
all as expected)

Then on the end B Linux machine i wanted to copy the same stuff locally
to that machine, so I used scp to copy from the mount back to localhost:
scp -r /mnt/endA/ ryan at localhost:/home/ryan/  I used scp to see the
progress as I expected it to also take 6 minutes.

This completed in around 40 seconds.  I stared at it for another 40
seconds a little puzzled and then tried it again - same result.  The
full 10MB was now sitting locally on the end B Linux machine, all
checksums match, nothing out of the ordinary.

I then tried it with standard cp: cp -Rv blah blah  - same results - 40
seconds - every file intact.

trafshow during the scp transfer shows a bit of data going between the
ends and the actual data travelling locally at "it can't possibly be
that fast over our PVC" speeds:

tcp  localhost   ssh    localhost      39836      122162    6568158
tcp  10.1.0.3    netbio wind-tunnel    39389      175560     150546

<--- end of historical naivety ---------------------------->

I simply wanted to know - eh?  I then read some things about smbfs
caching, but never experienced it before - is it really this good?

If it is, I am seriously impressed and can highly recommend it for cross
mounting anything across any kind of link for repetitive access - if PVC
traffic is free for you as it is for us, copy the entire share overnight
and then run from the cache the next day :) ... which begs the question:
Does anyone know the extent of the smbfs caching?  File size limits (so
far I can confirm up to 300KB), total cache size, retention periods
etc.?

The kernel source of relevance (fs/smbfs/cache.c -
include/linux/smb_fs.h etc.) doesn't make much sense to me and I haven't
really looked further.

Ryan



More information about the plug mailing list