portalab
asked on
Tweaking a samba based NAS for gbit
I recently built a NAS box with the amition to allow it to serve the SMB network lightning fast.
The server itsefl is capable of delivering excellent speeds, for example FTP transfers goes up to 80-90mb/s.
However the samba speeds never goes past ~30mb/s and I've spent quite some time trying to optimize this.
There is plenty of available resources in the server, so huge buffers etc is not a problem.
The OS is running Ubuntu 2.6.22-14-server with the stock kernel. No extra TCP/IP tweaks are made.
The NIC is a Intel Corporation 82545GM Gigabit Ethernet Controller (rev 04).
Jumbo Frames is turned off for the moment, speed acctually decrease when I turn it on.
How can I make samba faster?
My current samba optimization settings as following
The server itsefl is capable of delivering excellent speeds, for example FTP transfers goes up to 80-90mb/s.
However the samba speeds never goes past ~30mb/s and I've spent quite some time trying to optimize this.
There is plenty of available resources in the server, so huge buffers etc is not a problem.
The OS is running Ubuntu 2.6.22-14-server with the stock kernel. No extra TCP/IP tweaks are made.
The NIC is a Intel Corporation 82545GM Gigabit Ethernet Controller (rev 04).
Jumbo Frames is turned off for the moment, speed acctually decrease when I turn it on.
How can I make samba faster?
My current samba optimization settings as following
socket options = TCP_NODELAY IPTOS_LOWDELAY
read raw = yes # Default
write raw = yes # Default
oplocks = yes # Default
max xmit = 65535 # Default
dead time = 15 # Default is 0
getwd cache = yes
lpq cache = 30
ASKER
Tried these settings:
echo "2097136" > /proc/sys/net/core/rmem_ma x
echo "1048560" > /proc/sys/net/core/rmem_de fault
echo "2097136" > /proc/sys/net/core/wmem_ma x
echo "1048560" > /proc/sys/net/core/wmem_de fault
echo "65536 1398080 2796160" > /proc/sys/net/ipv4/tcp_rme m
echo "65536 1398080 2796160" > /proc/sys/net/ipv4/tcp_wme m
echo "3129344 3137536 3145728" > /proc/sys/net/ipv4/tcp_mem
echo "32768" > /proc/sys/net/ipv4/tcp_max _orphans
echo "163840" > /proc/sys/net/core/optmem_ max
sysctl -w net.ipv4.tcp_window_scalin g=1
echo 1 > /proc/sys/net/ipv4/tcp_tim estamps
echo 1 > /proc/sys/net/ipv4/tcp_sac k
sysctl -w net.ipv4.route.flush=1
ifconfig eth0 txqueuelen 1000
sysctl -w net.core.netdev_max_backlo g=2500
And then trying different RSIZE and WSIZE values, but speeds never went up.
But like I said in the original post FTP is very fast as it is, so tweaking in the TCP/IP layer shouldnt be needed. Is Samba just a slow protocol? Anybody acctually got speeds from samba close to FTP speeds?
echo "2097136" > /proc/sys/net/core/rmem_ma
echo "1048560" > /proc/sys/net/core/rmem_de
echo "2097136" > /proc/sys/net/core/wmem_ma
echo "1048560" > /proc/sys/net/core/wmem_de
echo "65536 1398080 2796160" > /proc/sys/net/ipv4/tcp_rme
echo "65536 1398080 2796160" > /proc/sys/net/ipv4/tcp_wme
echo "3129344 3137536 3145728" > /proc/sys/net/ipv4/tcp_mem
echo "32768" > /proc/sys/net/ipv4/tcp_max
echo "163840" > /proc/sys/net/core/optmem_
sysctl -w net.ipv4.tcp_window_scalin
echo 1 > /proc/sys/net/ipv4/tcp_tim
echo 1 > /proc/sys/net/ipv4/tcp_sac
sysctl -w net.ipv4.route.flush=1
ifconfig eth0 txqueuelen 1000
sysctl -w net.core.netdev_max_backlo
And then trying different RSIZE and WSIZE values, but speeds never went up.
But like I said in the original post FTP is very fast as it is, so tweaking in the TCP/IP layer shouldnt be needed. Is Samba just a slow protocol? Anybody acctually got speeds from samba close to FTP speeds?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Alot of good ideas, sadly none of them gave any real improvement. I guess the SMB protocol is simply too limited. Time to try iSCSI or something similar :)
# increase TCP max buffer size # default 131071
net.core.rmem_max = 524288
net.core.wmem_max = 524288
# default 110592
net.core.rmem_default = 262144
net.core.wmem_default = 262144
# increase Linux autotuning TCP buffer limits
# default 4096 87380 174760
net.ipv4.tcp_rmem = 4096 262144 524288
# default 4096 16384 131072
net.ipv4.tcp_wmem = 4096 262144 524288
# increase backlog # default 300 or 1000
net.core.netdev_max_backlo
also, for smb socket options, don't forget about buffers, try even larger than the below
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192
DISCLAIMER - those are just thoughts - no guarantee ;)