I am trying to set up a caching link between two points, that can be shared with windows and *nix. In both locations, I have linux-based servers with data, which have caching NFS mounts (that is, mount -t nfs -o fsc, with cachefilesd). These mounts are working correctly and I have tested the cache locally to much success. What I have not been able to get working is sharing those mounts with Windows-based workstations via samba. When I access a samba share of the NFS mount, windows clients *can* correctly access the data; however, they fetch the original file from the origin server every time, apparently bypassing the NFS cache. Does anyone know how I can avoid this behavior? Thanks, -Andy
On Thu, Mar 3, 2011 at 2:24 PM, Andrew Wilkinson <drukargin at gmail.com>wrote:> I am trying to set up a caching link between two points, that can be shared > with windows and *nix. In both locations, I have linux-based servers with > data, which have caching NFS mounts (that is, mount -t nfs -o fsc, with > cachefilesd). These mounts are working correctly and I have tested the > cache locally to much success. > > What I have not been able to get working is sharing those mounts with > Windows-based workstations via samba. When I access a samba share of the > NFS mount, windows clients *can* correctly access the data; however, they > fetch the original file from the origin server every time, apparently > bypassing the NFS cache. > > Does anyone know how I can avoid this behavior? > > Thanks, > > -Andy >Is there any more information I can give that might help anyone better understand the scenario? Thanks, -Andy
On Wed, Mar 09, 2011 at 09:42:47AM -0800, Andrew Wilkinson wrote:> Is there any more information I can give that might help anyone better > understand the scenario?Samba does normal posix calls. Can you point out in strace which of the calls breaks the caching? Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen
On Wed, Mar 9, 2011 at 4:30 PM, Andrew Wilkinson <drukargin at gmail.com>wrote:> On Wed, Mar 9, 2011 at 3:19 PM, Andrew Wilkinson <drukargin at gmail.com>wrote: > >> On Wed, Mar 9, 2011 at 9:46 AM, Volker Lendecke < >> Volker.Lendecke at sernet.de> wrote: >> >>> On Wed, Mar 09, 2011 at 09:42:47AM -0800, Andrew Wilkinson wrote: >>> > Is there any more information I can give that might help anyone better >>> > understand the scenario? >>> >>> Samba does normal posix calls. Can you point out in strace >>> which of the calls breaks the caching? >>> >>> Volker >>> >>> -- >>> SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen >>> phone: +49-551-370000-0, fax: +49-551-370000-9 >>> AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen >>> >> >> I'm sorry to say I'm not very familiar with what I should be looking for >> in the strace outputs. However, on comparing the outputs of the samba >> process and a cp process that successfully hit the cache, the only real >> differences I'm noting are that cp is using read() and samba is using >> pread(). Samba also does some mojo with fcntl, I believe setting locks on >> ranges of the file. >> >> If you'd like, I can give you those strace logs. >> >> Thanks! >> >> -Andy >> > > As a point of interest, the option "read raw = no" appears to allow the use > of the cache. The hits seem to expire more quickly than they should, > though, it seems like. If I don't touch a file for more than a minute or > so, it copies the whole thing again. > > Thanks, > > -Andy >Putting this back on the list because I accidentally derailed it. Thanks for calling that to my attention, Volker! -Andy
On Wed, Mar 9, 2011 at 4:30 PM, Andrew Wilkinson <drukargin at gmail.com>wrote:> On Wed, Mar 9, 2011 at 3:19 PM, Andrew Wilkinson <drukargin at gmail.com>wrote: > >> On Wed, Mar 9, 2011 at 9:46 AM, Volker Lendecke < >> Volker.Lendecke at sernet.de> wrote: >> >>> On Wed, Mar 09, 2011 at 09:42:47AM -0800, Andrew Wilkinson wrote: >>> > Is there any more information I can give that might help anyone better >>> > understand the scenario? >>> >>> Samba does normal posix calls. Can you point out in strace >>> which of the calls breaks the caching? >>> >>> Volker >>> >>> -- >>> SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen >>> phone: +49-551-370000-0, fax: +49-551-370000-9 >>> AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen >>> >> >> I'm sorry to say I'm not very familiar with what I should be looking for >> in the strace outputs. However, on comparing the outputs of the samba >> process and a cp process that successfully hit the cache, the only real >> differences I'm noting are that cp is using read() and samba is using >> pread(). Samba also does some mojo with fcntl, I believe setting locks on >> ranges of the file. >> >> If you'd like, I can give you those strace logs. >> >> Thanks! >> >> -Andy >> > > As a point of interest, the option "read raw = no" appears to allow the use > of the cache. The hits seem to expire more quickly than they should, > though, it seems like. If I don't touch a file for more than a minute or > so, it copies the whole thing again. > > Thanks, > > -Andy >This is apparently not the whole answer, as trying to duplicate things on another computer does not appear to have had the same effect. Of potential note, the computer that (sorta) works is running kernel 2.6.34 and samba 3.4.12 (gentoo with xen-sources), and the computer that may not work is running kernel 2.6.35 and samba 3.4.7 (ubuntu). Any other thoughts? Thanks, -Andy
On Thu, Mar 10, 2011 at 10:03:58AM -0800, Andrew Wilkinson wrote:> This is apparently not the whole answer, as trying to duplicate things on > another computer does not appear to have had the same effect. Of potential > note, the computer that (sorta) works is running kernel 2.6.34 and samba > 3.4.12 (gentoo with xen-sources), and the computer that may not work is > running kernel 2.6.35 and samba 3.4.7 (ubuntu). > > Any other thoughts?No, except that this sounds more like a kernel issue than a Samba one. The kernel folks should be able to decipher the straces and show what Samba could do differently. With best regards, Volker Lendecke -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen