Koozali.org: home of the SME Server

FYI revisiting and testing speed on samba smb shares

Offline purvis

  • *****
  • 567
  • +0/-0
FYI revisiting and testing speed on samba smb shares
« on: January 30, 2013, 09:11:43 AM »
Some external web reading for those who are interested.

http://www.psc.edu/index.php/networking/641-tcp-tune
http://helpful.knobs-dials.com/index.php/SMB,_CIFS,_Samba,_Windows_File_Sharing_notes

We have windows 2000 and XP that use SMB1 for the tcpip sharing protocol.
Some background on our systems.
We use smb1 to access sme server where there are databases that are accessed in shared mode.
Opportunistic file locking has to be turned off while accessing those database files. Without going into big details, we only have slow file access while mostly daily and monthy reports.
That is basically when indexes are rebuilt and long customer records are read. A rebuild of the software could solve the issue of slow accesss to those files. Of course if we could use the opportunistic file locking, everything would be cherry red. But that will not happen.

So i have done a lot testing and using veto oplocks in the smb.conf file, i am able to make some small tweaks to increase speed.  I could disable oplocks on all workstations in the registry in all but one, and have a single computer for running those reports with oplocks turn on. But i could you bet you, somebody would start using that computer and damage the database files while others are using those databases files. So that is not going to happen either.

After doing all things under the sun to make all things happen, including using tcp autotuning(that is now active and a part of the sme server with the new kernels) and removing SO_SNDBUF and  SO_RCVBUF from the socket options line of the smb.conf file.

I have come down to this after many hours of testing.

On the sme server and in the /etc/e-smith/templates-custom/etc/smb.conf directory, i added a file name 11socketOptions
Code: [Select]
socket options = TCP_NODELAY  SO_SNDBUF=8760 SO_RCVBUF=16384

and i also have another file named 11oplocks containing file names that i do not want oplocks to work with
Code: [Select]
veto oplock files = /*.CCC/*.AAA/*.III/FRM*.*/*.CEX/AP*.BBB/*.WPD/*.123/*.DOC/*.SEC/*.APL/*.TXT/*.WK?/



On most all the windows workstations i have disable oplocks, then on the other two i have, i left oplocks enabled on the windows machine i use as a backup computer for the server and the other machine we do reports on.

Using a program Drtcp, my receive window is set to 64240 and all other options turned off(No) where there is a Yes,No, or Default option. Max Duplicate Acks=2, TTL=64, and MTU 1500 on the network interface.
Using regedit in windows, i added a registry TcpDelAckTicks=1.  You can search how to add TcpDelAckTicks on the internet. Adding TcpDelAckTicks=1 did me a lot of good. The default setting is 0, which actually equals for a setting of 2.

I played with the socket options setting a lot, more than most would ever try and those setting above are doing me the most good for what software we are running.

PS. If we could of allowed for the Opportunistic File Locking to be running, the reports would be running in 18 to 30 seconds. But our databases are more important than the extra 2 minutes per day of extra time.  These reports on some systems where taking 20 minutes.

Have a good day and i hope i gave you something to try, if you are having problems as well. We do not have but about 6 workstations per server.
« Last Edit: January 30, 2013, 12:46:45 PM by purvis »

Offline purvis

  • *****
  • 567
  • +0/-0
Re: FYI revisiting and testing speed on samba smb shares
« Reply #1 on: January 30, 2013, 12:54:31 PM »
I will some more minor information here later, today.
I did not change TcpAckFrequency. The default setting is 2. If the Windows registry setting does not exist or equals 0, then it also equals to 2.

To get a lot of detailed tcp setting on the sme server enter command below
Code: [Select]
sysctl -a | fgrep tcp