SMB4 tuning: where and how ?

Status
Not open for further replies.

156ffe93

Cadet
Joined
Feb 21, 2015
Messages
9
Hi all

Situation:
I have an Atom 330 small server, 1x4 Tb disk. FreeNas 9.3, Gb interfaces on PC, router (checked), NAS
Have Windows PC, and CIFS for share (tried NFS as well, its SMB for now)

Wish:
Id like to do some SMB tuning: system reaches speeds up to 40Mbs with a huge movie file, and like some more.

Done:
Found some tuning parametes (below), but dont know how to tune the system.
Editing etc/local/smb4.conf does not work: smb4.conf apperears to be reset after re-starting CIFS deamon.

Q:
Where and how do I add these SMB parameters: ??

socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY
min receivefile size = 16384
use sendfile = true
aio read size = 16384
aio write size = 16384

Thanks in advance
W
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Umm... you need to do more reading. The defaults are already better than those, and sendfile no longer exists in Samba4 as far as I know.

So you might want to think about the source, and how old it is. I'm betting it's totally inappropriate to consider those settings.

Also, an Atom 330 is *going* to be slow. It's not really appropriate for a machine that is being depended on to be fast. No amount of tuning is going to fix it because Samba is a single-threaded application. Those 330s already suck on a per-core basis, so there is no fixing it.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Q:
Where and how do I add these SMB parameters: ??

socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY
min receivefile size = 16384
use sendfile = true
aio read size = 16384
aio write size = 16384

Thanks in advance
W

FYI, those parameters are oft-repeated samba voodoo. If you look at the samba mailing lists, one of the first questions they ask people having performance problems is "have you set any socket options? If so, remove them." The best tuning you can do is getting something with better hardware.
 

156ffe93

Cadet
Joined
Feb 21, 2015
Messages
9
... but after reconsideration, a questions remains:

Since I cant tune the system via editing .conf since the system rewrites it, how do I tune Freenas (on this subject)?

Is this the trick ?
http://olddoc.freenas.org/index.php/CIFS (referring to 40 Mbs for an Atom, so seems maxed already)
Samba's "write cache" parameter has been reported to improve write performance in some configurations and can be added to the Auxiliary Parameters field. Use an integer value which is a multiple of _SC_PAGESIZE (typically 4096) to avoid memory fragmentation. This will increase Samba's memory requirements and should not be used on systems with limited RAM.
 
Last edited:

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
... but after reconsideration, a questions remains:

Since I cant tune the system via editing .conf since the system rewrites it, how do I tune Freenas (on this subject)?

Is this the trick ?
http://olddoc.freenas.org/index.php/CIFS (referring to 40 Mbs for an Atom, so seems maxed already)
Samba's "write cache" parameter has been reported to improve write performance in some configurations and can be added to the Auxiliary Parameters field. Use an integer value which is a multiple of _SC_PAGESIZE (typically 4096) to avoid memory fragmentation. This will increase Samba's memory requirements and should not be used on systems with limited RAM.
You don't really tune FreeNAS. For 99.1% of users, FreeNAS should *NOT* be tuned.

Anything that is tune-able will be an option in the GUI itself. Those will persist (i.e., not be overwritten).
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Das_Blinkenlights.gif
 

156ffe93

Cadet
Joined
Feb 21, 2015
Messages
9
No offense, but in CIFS tab, Aux params: added

max xmit = 65535
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535
read raw = yes
write raw = yes
max connections = 65535
max open files = 65535

(adding these made little diff)
min receivefile size = 16384
use sendfile = true
aio read size = 16384
aio write size = 16384
CIFS perf changed from 7 Mbytes/s to 45 Mbytes/s

Ill settle for that
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
156 can you put that in a freenas bug ticket? would be interesting what the devs think about it

The parameters listed above are a typical shotgun approach to trying to make things more fasterer. Not terribly interesting.

"read raw = yes" is a default parameter. Same with "write raw = yes". Setting these doesn't do anything.
Samba documentation regarding "max open files" states "The limit of the number of open files is usually set by the UNIX per-process file descriptor limit rather than this parameter so you should never need to touch this parameter."
The default for "max connections" in samba is "0", which means no limit - i.e. infinite. Setting a value actually decreases the amount of possible concurrent connections. Since the value is set to "65535" (which won't happen), this setting is currently doing nothing.
"minimum receivefile size" affects how samba process smbwritex calls. I believe this only affects NT1 connections. SMB2 uses smb2write calls. (Hence, no effect on Windows Vista and later).
"max xmit" documentation states "You should never need to change this parameter from its default value."
I'm also skeptical that use sendfile and aio settings would affect performance much.

So we're left with the socket options (tuning send / receive buffers).

I think they'd chalk it up to running unsupported (or poorly supported) and under-powered hardware. Possibly the combination of atom processor, lack of RAM, with realtek NIC, but I wouldn't rule out some underlying network problems (perhaps flakey / low-end switch, or a wifi connection.

For some samba dev negativity regarding samba tuning, see Jeremy Allison's posts in samba mailing lists here: https://marc.info/?l=samba&m=139714587027299&w=2.
 
Last edited:

156ffe93

Cadet
Joined
Feb 21, 2015
Messages
9
Switch is OK: Linksys E3000 with latest OpenWRT, 1 Gb network connections.
FreeNAS box with Atom and 2 G mem will definitely be limiting. Its intended as a low energy backup facility.

Large file (see attch) : 47 Mbytes/s. Lots of smaller files: drops down to 7 Mbytes/s again. Makes sense

Ill do some more testing and tweaking, just curious.. Undo it, and see what happens. Let you know
 

Attachments

  • Freenas copyspeed.png
    Freenas copyspeed.png
    4.9 KB · Views: 482
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Depends:
http://storageroot.com/articles/nas4free-freenas-amahi-openmediavault:
Some of the other open source NAS might possibly offer more features than FreeNAS; however, FreeNAS seems far more stable, professional and organized than many of the other NAS options out there.

Ill stick to my baby.

You're stuck on an EOL version of FreeNAS. FreeNAS is now ZFS only and your atom processor tops out at 4GB RAM. I suggested using another OS because it is better suited for your hardware. It has nothing to do with graphical interfaces, etc.
 
Status
Not open for further replies.
Top