SOLVED Browsing directories slow

Status
Not open for further replies.

Deaks2

Dabbler
Joined
Jun 30, 2012
Messages
12
Thanks for answering. I used the information in post 7, however, I will try the CIFS settings from post 5 tonight. I am indeed running the x64 version of FreeNAS. I did have one of my disks fail a few weeks ago, but I got a replacement and it reslivered a-ok. Zpool status is good (checked from the CLI). Not to mention that was on my previous 8.04-Multimedia setup and not the new 8.2b4 setup which has a newly created pool.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Which posting above did you use the settings from? Post #5 or #7?
I actually thought this [post=28793]post[/post] was the latest & greatest. Maybe that's not for slow directory browsing though?

As protosd said Samba shouldn't be crashing.


I have seen people with hardware problems (bad or failing disks) have problems with slow transfer speeds.
[thread=7637]Case in point[/thread]. A single disk can/will pull the entire pool down.

I did have one of my disks fail a few weeks ago, but I got a replacement and it reslivered a-ok. Zpool status is good (checked from the CLI).
I'd run some long smart tests against all the disks and see if that turns anything up.


Delete your current tunables, rerun Auto-Tune and leave the vfs.zfs.arc_max & kernel memory tunings alone for now. Have you tried adding the CIFs settings one at a time? I'd start with:
Code:
socket options = SO_RCVBUF=131072 SO_SNDBUF=131072


After you set the tunables, e.g.
Code:
kern.ipc.maxsockbuf = 16777216
net.inet.tcp.recvbuf_max = 16777216		
net.inet.tcp.sendbuf_max = 16777216
Actually you could drop those down to 131072 first.

Also, I couldn't see any of your screenshots as I won't turn on javascript for dropbox.
 

Deaks2

Dabbler
Joined
Jun 30, 2012
Messages
12
Extended SMART tests for all 4 disks come up clean. I've figured out that the "max xmit" variable in CIFS causes samba to exit on signal 6.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
What client(s) are you using? What's in the top level of your share?

Extended SMART tests for all 4 disks come up clean. I've figured out that the "max xmit" variable in CIFS causes samba to exit on signal 6.
Leaving it out, any noticeable change?

max xmit (G)
  • This option controls the maximum packet size that will be negotiated by Samba. The default is 16644, which matches the behavior of Windows 2000. A value below 2048 is likely to cause problems. You should never need to change this parameter from its default value.

    [*]Default: max xmit = 16644

However, browsing my single CIFS share is quite slow, directory listings (especially my 19000+ file MP3 folder) are slow.
I recently read a recommendation, for Samba, to turn off atime for directories with a very large number of files.


Have you tried creating a small test share with only a couple of folders & only half a dozen of files in each?
 

Deaks2

Dabbler
Joined
Jun 30, 2012
Messages
12
Client is Win7 x64. Zpool is /mnt/tank, CIFS share is a folder called /mnt/tank/CIFS.

The folder that causes the most problems is my music folder with 19k+ files. My movies folder with 229 files comes up just fine.

With the mods from your post and/or the protosd's posts (including the one you linked to). No discernible difference in performance.

Where would I kill atime? Using the Samba conf file?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Where would I kill atime? Using the Samba conf file?
Deaks2 if you are still looking for this, you turn of atime under ZFS options for the dataset. You can also double check that Win7 isn't trying to index anything on the share. What's the view option you are using for the music folder anyway?

There's another rather hackish Samba performance tweak, but they talk about it with directories with over 100,000 files in it. It shouldn't apply in your case.
 

thisisonlyme

Cadet
Joined
Jul 19, 2012
Messages
5
I have the exact same issue.
File transfer with CIFS is remarkably slower then when using FTP. I can live with that.

Browsing directories (containing 10 000 files) with CIFS is giving me a headache.
Browsing the same directories with SSH is ok (10 000 files in one directory, opens within less than a second).
I've tried the hints from paleoN (sysctls, CIFS auxilary parameters, atime). Without any result. (Thanks anyway for your help!)

FreeNAS-8.0.4-RELEASE-p1-x64 (11059), boot from USB-stick, 4 GB RAM, 3TB 7200 RPM disks.
Disks are ok (Long S.M.A.R.T. tests). Gigabit NIC is ok.
FreeNAS reporting (rrdtool graphs via GUI) tells me the system is OK and it is not swapping.

Any help would be appreciated.

This is what I've tried:
Code:
socket options = SO_RCVBUF=131072 SO_SNDBUF=131072

Code:
kern.ipc.maxsockbuf = 16777216
net.inet.tcp.recvbuf_max = 16777216
net.inet.tcp.sendbuf_max = 16777216
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
I've tried the hints from paleoN (sysctls, CIFS auxilary parameters, atime). Without any result. (Thanks anyway for your help!)
Unless you're Deaks2 in disguise I don't remember helping you. What's more the suggestions I made were a starting point as Samba was crashing on him and not a replacement for everything.

It seems like you're missing quite a few of the ones I recommended, you can't just mix and match them. Try them all, then remove or adjust them one at a time (some of them work in groups or pairs).
+1

Another thing to keep in mind is I never had a slow browsing problem whereas protosd did and fixed it with his settings. I haven't done any in-depth CIFs tuning yet either.
 

thisisonlyme

Cadet
Joined
Jul 19, 2012
Messages
5
Ok, sorry for mixing some things up. The thread is a sticky and is called "Browsing directories slow" so I was assuming this was the correct thread for my question instead of creating a new thread.

I'll try to add following sysctls and see what happens.
Code:
kern.maxvnodes                          250000
kern.coredump                           0
kern.dirdelay                           4
vfs.zfs.prefetch_disable	        0
vfs.zfs.zil_disable	                0
vfs.zfs.txg.timeout	                5
vfs.zfs.txg.synctime	                1
vfs.zfs.vdev.max_pending	        35
vfs.zfs.vdev.min_pending	        4
vfs.zfs.txg.write_limit_override	1073741824
vfs.nfsrv.async	                        0
net.inet.tcp.sendbuf_max	        16777216
net.inet.tcp.recvbuf_max	        16777216

Auxilary
Code:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=98304 SO_SNDBUF=98304
getwd cache = yes
 

thisisonlyme

Cadet
Joined
Jul 19, 2012
Messages
5
I've added all the sysctls and the axilary code for the CIFS sevice. No difference in directory listing speed.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
FreeNAS-8.0.4-RELEASE-p1-x64 (11059), boot from USB-stick, 4 GB RAM, 3TB 7200 RPM disks.

On my home system one of my machines is limited to 100Mb network connection, and when I created 10000 files in a directory it would open in less than 2 seconds with my typical system(12GB of RAM). When I changed my system to 4GB of RAM the performance was terrible.

Have you considered upgrading the RAM? 4GB is really the minimum recommended, and you can NEVER have too much RAM.

Edit: How many 3TB drives do you have? The thumbrule is 4GB + 1GB for each TB of storage space on your zpool. Something tells me your system may be starved for RAM.
 

thisisonlyme

Cadet
Joined
Jul 19, 2012
Messages
5
Thank you for your answer, noobsauce80.

I have 4 x 3 Terabyte disks in a RAID-Z2 pool. The zpool is 5.8 Terabyte. I now have 4 Gygabyte RAM but your rule means I should need 9 or 10 Gigabyte of RAM? (I didn't knew about that thumbrule. Sorry.)

When I open the Reporting from the FreeNAS WebGUI I can see the physical memory is used 100% (leaving +- 100 megabyte free) but swap is 100% free.
 

Deaks2

Dabbler
Joined
Jun 30, 2012
Messages
12
Good day everyone,

Sorry for not checking in lately. I still have an issue with directory listings. I disabled aitime and did not see a noticible improvement. On my Win7 machine I changed the folder customization to Documents instead of General, as per some postings on the 'net, however, that did not really improve it either.

If you watch explorer list a directory on my machine, the item count jumps by 1000 at a time for the first 10k-15k files, after which it slows down to 100-200 items at a time.

If I have been accessing the share a lot, ie: moving files over or plyaing media, the directory listings are much quicker, in the order of 5 seconds, instead of 10-60 seconds.

This is very strange. I had the same issue with v8.04-Multimedia. My old D-Link DNS-323 never had such issues, however, it was generally slow at file transfers.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The swap used in FreeNAS 8 is not used the same as Windows. You should strongly consider upgrading your RAM. You may find that you will not be able to achieve the performance you want with the RAM you have. You are lucky, alot of people have kernel panics and random other odd behavior with only 4GB of RAM. Typically people use 16GB of RAM for their systems because 4GB sticks are very cost effective.
 

thisisonlyme

Cadet
Joined
Jul 19, 2012
Messages
5
"ls -al" command via ssh works just fine in all directories. So I'm afraid it has something to do with CIFS.

I have removed all sysctl variables and the CIFS auxilary settings.

Any help is appreciated.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The best way to get the most out of your FreeNAS™ system is to install as much RAM as possible. If your RAM is limited, consider using UFS until you can afford better hardware. ZFS typically requires a minimum of 6 GB of RAM in order to provide good performance; in practical terms (what you can actually install), this means that the minimum is really 8 GB. The more RAM, the better the performance, and the Forums provide anecdotal evidence from users on how much performance is gained by adding more RAM. For systems with large disk capacity (greater than 6 TB), a general rule of thumb is 1GB of RAM for every 1TB of storage.

NOTE: by default, ZFS disables pre-fetching (caching) for systems containing less than 4 GB of usable RAM. Not using pre-fetching can really slow down performance. 4 GB of usable RAM is not the same thing as 4 GB of installed RAM as the operating system resides in RAM. This means that the practical pre-fetching threshold is 6 GB, or 8 GB of installed RAM. You can still use ZFS with less RAM, but performance will be effected.

If you are installing FreeNAS™ on a headless system, disable the shared memory settings for the video card in the BIOS.
The manual isn't kidding about considering UFS until you can afford better hardware either. There's lots of threads in the forum with the answer being "more RAM". You can also review the presentation I have in my signature for other useful common mistakes newbies make. :)
 
Status
Not open for further replies.
Top