Home » Debian, Linux, Tuning

Speed up Samba under Linux

12 November 2008 No Comment

I will try to explain how I speedup a huge loaded Samba fileserver from my office.

By default Samba comes with some default parameters what are working perfect for a usual fileserver but NOT for a very loaded one. So in your smb.conf in global section just add:

read size = 65536
read prediction = true
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
write raw = yes
read raw = no

Usually raw read and write is enabled, but on some clients will work better with it disabled. Just test it.

The second task is to speed up a little bit the disk access. So if you have a partition dedicated for the file server (and this is normal to have for a dedicated fileserver) you can disable “last accessed time” (what is a slow operation) for the files. To do that just modify fstab and add noatime option to your partition. Example:

/dev/sda1 /fileserver ext3 noatime 1 2

And remount the partition:

mount -oremount,rw /fileserver

Another thing is to configure your firewall to accept connection from 137,138,139 AND 445 TCP/UDP. Usually a lot of people knows about 137,138,139 and not about 445 port. Windows 2K and Windows XP use that port before trying 139.

Also you need to see if you have enough RAM and your system is not swapping. To see if your system is swapping or not just run the following command:

free -m
             total       used       free     shared    buffers     cached
Mem:          2014       1987         27          0         38        703
-/+ buffers/cache:       1245        769
Swap:         1906        308       1597

And if you have used swap then probably you will need more RAM, but monitor the system to see if is using swap all the time or it was just a temporary glitch.


Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.