1

I own a personnal Fileserver, build on an AMD X2 platform, with an intel gigabit CT network adapter, running debian 6.0.

I've built a raid5 (2To x 3), shared by samba 3.5.6

From my desktop computer (windows7), when copying big files, sometimes the download/upload speed is steady around 55/60Mb/s, sometimes, it's really unstable, drops to from 1 or 2Mb/s, with a maximum of 20/30Mb/s, really unstable.

I've tested also using samba shares on raid and main disk, results are similar.

I've run some hdparm -tT on the server :

/dev/sda:
  Timing cached reads:   4698 MB in  2.00 seconds = 2349.11 MB/sec
  Timing buffered disk reads: 374 MB in  3.00 seconds = 124.49 MB/sec

/dev/md0:
 Timing cached reads:   4814 MB in  2.00 seconds = 2407.76 MB/sec
 Timing buffered disk reads: 640 MB in  3.00 seconds = 213.02 MB/sec 

Also, I've used iperf to test the bandwidth between the two computers :

iperf.exe -c pacem -n 1073741824 -fm
------------------------------------------------------------
Client connecting to pacem, TCP port 5001
TCP window size: 0.06 MByte (default)
------------------------------------------------------------
[  3] local 10.0.0.145 port 50913 connected with 10.0.0.37 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-68.7 sec  1024 MBytes   125 Mbits/sec 

How can I proceed to find efficiently where the problem is ?

Thanks for reading!

1 Answers1

5

The problems you are describing are most likely due to three factors:

  1. socket options in the [global] section of your smb.conf file. A good baseline to start with is:

    socket options = IPTOS_THROUGHPUT TCP_NODELAY SO_KEEPALIVE
    

    See how that works; it's usually enough to get Samba "out of the way" for performance bottlenecks. For other options check out the Samba page; notably SO_SNDBUF and SO_RCVBUF. Setting these values incorrectly will affect performance negatively; this may take some trial and error.

  2. Making the aforementioned worse, the size of the files affects Samba. Small files have more overhead. And if you tune your socket options for bulk transfers you'll see small file speed get worse. Similarly tuning for tiny files makes large file transfers worse. Ideally you'll figure out what you transfer most often, or what makes the biggest differences to you (slow on a 4GB DVD ISO is usually more meaningful than slow on a 1KB file).

  3. DNS and VFS settings. If you don't have DNS forward and reverse mapping correctly configured you'll want to disable Samba's DNS lookups (dns proxy = no and hostname lookups = no). This is most evident when you first connect to a Samba share (if it takes longer than 5 seconds, this is the problem).

    There's a variety of VFS and related options that can be configured in Samba's [global] section. If they're wrong, Samba will have to deal with errors when opening/saving each file. The settings appropriate for your server will depend on it's filesystem, security, and some of the features you want enabled. There's no quick answer to this part, but it makes the least difference overall.

Chris S
  • 78,455