Slow share mount speeds [AFP & SMB]

Status
Not open for further replies.

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Hey Guys,

Wanted to post my experience with slow mounting / response of shares on my FreeNAS. Current hardware setup:
Motherboard: ASRock 350M1/USB3
Memory: 2 x 4GB ARAM-Pro
NIC: 1Gbps
HDD's: 4 x 1TB SATA Samsung SpinPoint F3's
Storage setup: RAID-Z1 = 'online & health'
FreeNAs ver: 8.0 GA amd64

On a daily basis I have 3 clients connected to the NAS; 1 Mac over 802.11n using AFP for Time Machine shared storage drive, and 2 Windows7 x64 PC's over gigabit wire using smb.

I find that on all 3 clients, when I try to open the network shares (either using an already mapped drive in Windows or making a new connection on the Mac) the process is very slow. The delay is that bad that explorer on Windows appears to crash and become unresponsive - if left alone, the mapped drive contents appear. Once a share is open moving files to/from the drive is fast ~50MB/Sec read/write to/from NAS to client SSD, also transversing the folder structure is ok (although sometimes laggy).

Whilst I could deal with slow mounting of shares, it does become frustrating when playing media back from the NAS though MediaPortal, as the media takes around 20-30 seconds to start playing back.

Does any one else have issues like this? I've been running FreeNAS since early 0.7 and not experienced this slow mount problem so wondering if it something 8.0 related...?

P.s: Happy to provide any logs or system stats if required.

Cheers,
Andy
 
Joined
May 27, 2011
Messages
566
1. instead of using the host's name, try using it's IP.
2. try turning off authentication to see if that narrows it down.
3. disable All power saving features.
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Hi Matthew,

Thanks for your response.

- I usually map by IP but will make an effort to only use IP and see if that helps,
- I have just enabled guest access on the windows share settings,
- All power saving is already turned off,

- What this space -

Cheers,
Andy
 
Joined
May 27, 2011
Messages
566
not just guest access, just automagicaly map to guest.

in your smb.conf add

map to guest = Bad User

windows will automagicaly try to log in as guest, which will be a bad user so it will be mapped to your guest account. this will bypass nearly all the authentication which could be your issue.
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Hi Matthew,

being a bit of a noob to Free/NanoBSD it took me a while to realise that by samba.conf you meant smb.conf :) Anyway, using the locate command I found the file:
Code:
# locate smb.conf
/conf/base/etc/local/smb.conf
/conf/base/etc/local/smb.conf.sample
/etc/local/smb.conf
/etc/local/smb.conf.sample


Rightly or wrongly, I, assuming the file i need is /etc/local/smb.conf which reads as below:
Code:
 private dir = /var/etc/private
    getwd cache = yes
    guest account = www
    map to guest = Bad Password
    guest ok = yes
    netbios name = meemo-nas
    workgroup = WORKGROUP
    server string = FreeNAS Server
    use sendfile = yes
    large readwrite = no
    store dos attributes = yes
    local master = yes
    time server = yes
    security = user
    create mask = 0666
    create mask = 0666
    directory mask = 0777
    dos charset = CP437                        
    unix charset = UTF-8
    log level = 1


[Storage]
path = /mnt/Storage
printable = no
veto files = /.snap/
comment = ZFS Storage Root
writeable = yes
browseable = yes
inherit permissions = no
guest account = root
guest ok = yes



Doing some reading - http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html & http://www.linuxquestions.org/quest...ile-map-to-guest-guest-ok-=-yes-query-755628/ Im confused if the 'map to guest = bad user' will work in my config as i have the 'guest ok = yes' in the share config ... does this override the global setting? :confused:

Appreciate your help

Andy
 
Joined
May 27, 2011
Messages
566
sorry about that.

'guest ok' dictates whether or not a guest account is a valid option.
'map to guest' says under what conditions a user trying to authenticate will be vied as a guest account. i used it on my public shares so anyone can access them without me needing to setup a user and a password for them. upon looking at my conf file, map to guest is already set to bad user so i think it's the default setting.

'guest account = root'

that scares the CRAP out of me. you should change that to either 'guest account = www' or 'guest account = nobody' having it set to root (apparently the default???) allows anyone that is a guest to have root level access to your shared files.

everything else looks fine.

lets increase the logging level and see what it produces.

in the services tab, select CIFS, in the Auxiliary parameters section add these 2 lines:

log file = /mnt/Storage/smb.log
log level = 3

restart the service then have someone connect, wait until it finally works, then kill the cifs service, and post the log file.
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Well it took a while for me to get a clean log, as 2 log files are generated - smb.log & smb.log.old. I added the additional logging lines to the service & restarted the service, then tried to open the share on one of my windows 7 computers using the IP (not host name) of the NAS. It took a while to connect, then showed the share. At this point I quickly copied the log file before they changed size - Attached is the output. Hopefully it will mean more to you than me!:cool:

View attachment smb.log.zip

BTW, I have the embedded console running in the web gui of FreeNAS, thought you might be interested in the output as I was starting / stopping the cifs service

Code:
Jun  6 20:35:24 Meemo-NAS cnid_dbd[41531]: read: Connection reset by peer
Jun  6 20:35:24 Meemo-NAS cnid_dbd[41531]: error reading message header: Connection reset by peer
Jun  6 01:35:43 Meemo-NAS freenas[1532]: Executing: /usr/bin/killall nmbd
Jun  6 20:35:43 Meemo-NAS freenas: No matching processes were found
Jun  6 01:35:43 Meemo-NAS freenas[1532]: Executing: /usr/bin/killall smbd
Jun  6 20:35:43 Meemo-NAS freenas: No matching processes were found
Jun  6 01:35:43 Meemo-NAS freenas[1532]: Executing: /usr/sbin/service samba quietstart
Jun  6 20:35:44 Meemo-NAS freenas: Removing stale Samba tdb files: . done
Jun  6 20:35:44 Meemo-NAS freenas: Starting nmbd.
Jun  6 20:35:44 Meemo-NAS freenas: Starting smbd.
Jun  6 20:36:27 Meemo-NAS cnid_dbd[41531]: read: Connection reset by peer
Jun  6 20:36:27 Meemo-NAS cnid_dbd[41531]: error reading message header: Connection reset by peer
Jun  6 01:40:07 Meemo-NAS freenas[1532]: Executing: /usr/bin/killall nmbd
Jun  6 01:40:07 Meemo-NAS freenas[1532]: Executing: /usr/bin/killall smbd
Jun  6 01:40:07 Meemo-NAS freenas[1532]: Executing: /usr/sbin/service samba quietstart
Jun  6 20:40:08 Meemo-NAS freenas: Removing stale Samba tdb files: ....... done
Jun  6 01:40:12 Meemo-NAS freenas[1532]: Executing: /usr/sbin/service ix-samba quietstart
Jun  6 20:40:13 Meemo-NAS freenas: export_database: username="(NULL)"
Jun  6 20:40:13 Meemo-NAS freenas: tdbsam_open: Converting version 0.0 database to version 4.0.
Jun  6 20:40:13 Meemo-NAS freenas: tdbsam_convert_backup: updated /var/etc/private/passdb.tdb file.
Jun  6 20:40:13 Meemo-NAS freenas: tdb(unnamed): tdb_open_ex: could not open file /var/db/samba/winbindd_idmap.tdb: No such file or directory
Jun  6 20:40:13 Meemo-NAS freenas: TDBSAM converted successfully.
Jun  6 20:40:13 Meemo-NAS freenas: Importing account for root...ok
Jun  6 20:40:13 Meemo-NAS freenas: Importing account for andy...ok
Jun  6 20:40:13 Meemo-NAS freenas: Importing account for media...ok
Jun  6 20:40:13 Meemo-NAS freenas: Importing account for media2...ok
Jun  6 01:40:13 Meemo-NAS freenas[1532]: Executing: /usr/sbin/service samba reload
Jun  6 20:40:13 Meemo-NAS freenas: Performing sanity check on Samba configuration: OK
Jun  6 01:40:15 Meemo-NAS freenas[1532]: Executing: /usr/bin/killall nmbd
Jun  6 20:40:15 Meemo-NAS freenas: No matching processes were found
Jun  6 01:40:15 Meemo-NAS freenas[1532]: Executing: /usr/bin/killall smbd
Jun  6 20:40:15 Meemo-NAS freenas: No matching processes were found
Jun  6 01:40:15 Meemo-NAS freenas[1532]: Executing: /usr/sbin/service samba quietstart
Jun  6 20:40:15 Meemo-NAS freenas: Removing stale Samba tdb files: . done
Jun  6 20:40:15 Meemo-NAS freenas: Starting nmbd.
Jun  6 20:40:15 Meemo-NAS freenas: Starting smbd.
Jun  6 20:40:24 Meemo-NAS cnid_dbd[41531]: read: Connection reset by peer
Jun  6 20:40:24 Meemo-NAS cnid_dbd[41531]: error reading message header: Connection reset by peer


Andy
 
Joined
May 27, 2011
Messages
566
I'm going to be studying for my final on Tuesday, I'll try and get to the log soon, but it may be Tuesday evening before i can take a look.
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Just as a quick update, im not sure if the issue is confined to SMB as I have now mapped all network drives from my FreeNAS to Windows 7 over NFS and am still suffering the same 'slowness'. When I have some time, I might put another NIC on my NAS and test just to see if the issue is NIC related...
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Just to say that this issue is now resolved since moving to 8.0.1-Beta4_x64
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You might notice that if you upgrade your settings in smb.conf will get lost. I think the correct place to put them in the GUI is Sharing -> CIFS Shares, and then click on the share. In the pop-up window near the bottom is an area Auxiliary Settings.
 

cheongi

Dabbler
Joined
Aug 10, 2011
Messages
18
Been playing with iperf/jperf and FreeNAS8 on microserver, Win7, WinXP, MacOS10.5.8. Windows small TCP windows can be fixed using TCPOptimizer.exe from http://www.speedguide.net/downloads.php.

MacOS has problems, but tweaking several parameters has made a big difference.

http://blog.djmnet.org/2009/02/09/macs-needing-unix-network-geekery/

I am presently using:
net.inet.tcp.delayed_ack=0
net.inet.tcp.mssdflt=1440
net.inet.tcp.sockthreshold=16
net.inet.tcp.sendspace=1027840
net.inet.tcp.recvspace=1027840

I hope that's all, since I have been fiddling with performance for a while. Now AFP will transfer 8GB test file from FreeNAS to mac in 2:41 (51MB/sec), compared to 1:24 for FreeNAS to Win7. (97MB/sec) Part of the problem is reaching disk write speed limits.

Writing to FreeNAS takes about 4 times as long...so looking to tweak the FreeNAS settings.
 
Status
Not open for further replies.
Top