CIFS directory browsing slow? Try this

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
Interesting idea; since the dataset is already case-sensitive, it was just a matter of adding the option to the SMB share config and restarting samba.
Making things case-sensitive has the opposite effect in Samba. It slows down performance because the server has to perform multiple lookups per file. This is well documented in the samba mailing lists.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
I know that this is not about the FreeNAS server side of things, but has anyone experience with browsing shares in Linux Ubuntu? I have a medium-sized share with 10k+ files and dirs sitting on it, and Windows 10 browses are almost instantaneous.

I have taken the time-tested method of counting seconds, and with Windows 10 clients, I can barely count "21" until the dir opens.

Ubuntu's Nautilus file manager, on the other hand, takes a whopping 30 seconds to open the same share over the network. What can I improve here?

Sounds like a performance problem in Nautilus. Look for things that it's doing that are safe to turn off. For instance, generating thumbnails.
 

Pezo

Explorer
Joined
Jan 17, 2015
Messages
60
Making things case-sensitive has the opposite effect in Samba. It slows down performance because the server has to perform multiple lookups per file. This is well documented in the samba mailing lists.
But isn't this only the case when the file system itself is case-insensitive? Do you have a link handy to the mailing list posts you are talking about?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
But isn't this only the case when the file system itself is case-insensitive? Do you have a link handy to the mailing list posts you are talking about?

I'll look up the mailing list posts later. See the "Name Mangling" heading in the smb.conf manpage as well:
As part of the optimizations for directories containing large numbers of files, the following special case applies. If the options case sensitive = yes, preserve case = No, and short preserve case = No are set, then the case of all incoming client filenames, not just new filenames, will be modified.
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
Making things case-sensitive has the opposite effect in Samba. It slows down performance because the server has to perform multiple lookups per file. This is well documented in the samba mailing lists.
I read about this, but there are recent posts here in the FreeNAS forums that the default value of sensitivity yes is OK and shouldn't be changed. I am just transferring files to a new system, so insight and details are much appreciated.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
I read about this, but there are recent posts here in the FreeNAS forums that the default value of sensitivity yes is OK and shouldn't be changed. I am just transferring files to a new system, so insight and details are much appreciated.

It depends on which case sensitivity setting you're talking about (zfs dataset property or samba parameter). Whether any of these parameters make sense depends entirely on your environment. If a dataset is exclusively shared through samba, then creating it as case insensitive is a good option.
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
So, to sum it up, for a exclusive samba share, dataset case insensitivity and samba option case sensitive give the best speed. Seems to be fairly easy to implement for a new server. I'll give it a try.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,543
So, to sum it up, for a exclusive samba share, dataset case insensitivity and samba option case sensitive give the best speed. Seems to be fairly easy to implement for a new server. I'll give it a try.
Well, it optimizes performance when directories have large numbers of files in them. You probably won't see any performance benefit in other situations.

In the big picture, windows has a case insensitive, case-preserving filesystem. ZFS can do the same when casesensitivity=insensitive. Why use extra compatibility code in samba when it's technically not needed if you set up datasets properly from the beginning?
 
Last edited:
Joined
Sep 5, 2017
Messages
1
is this still the working solution for FreeNAS 11?
I've setup my samba configuration aux parameters with:

ea support = no
store dos attributes = no
map archive = no
map hidden = no
map readonly = no
map system = no

However, we are still observing that initial access via CIFS on Windows 7 Clients might take very long time till content of the share is shown.

I'm not sure if this really happens because of smb or is related to AD User mappings/syncs or whatever....
 
Last edited:

jonnysv

Cadet
Joined
May 10, 2017
Messages
1
Thanks to some recent work on the streams_xattr VFS module by @BaT, ea support has been de-coupled from Alternate Data Stream (ADS) support. It should be safe to set "ea support=yes" and keep streams_xattr enabled in FreeNAS 11.1+
I just tried it on FreeNAS 11.1U4 and the performance hit was still brutal. Quite a lot faster than earlier (I think), but still way slower than ea support = no.
 

jotauve

Cadet
Joined
Oct 28, 2019
Messages
9
Hi, we're using FreeNAS-11.2-U6, is this info still correct with 11.2??.

We have pools shared with SMB with only Windows clients. All pools were created with case sensitive = Sensitive.

We have read other posts and recommends create again with case Insensitive and replace vfs modules with "ixnas" (remove all others)

We can't recreate pools again, we have two options:

1) Try to replace vfs modules with "ixnas" (remove all others) and add dirsort keeping case sensitive.

2) Try to Disable DOS attributes using Auxiliary Parameters

ea support = no
store dos attributes = no
map archive = no
map hidden = no
map readonly = no
map system = no

Any two options is safe? This pools have backups and we can't lose them. (it's backed on S3/Glazier but it's about 6 TB of data). What is the best option?.

Thanks.
 
Top