[Samba] Re: Samba running slow

Aaron Kincer kincera at gmail.com
Thu Feb 1 17:24:39 GMT 2007

In pure mathematical terms, the maximum throughput on 100MB ethernet is:

100Mb / 8  = 12.5 MegaBytes per second.

That assumes, of course, a perfect world with a 100% efficient protocol. 
Of course, this doesn't exist. So in network design, if you have one 
100MB link from the switch your server is plugged into serving multiple 
clients, then best case throughput is:

12.5 / N

Where N is the number of clients pulling data from the Samba server at 
any moment in time. Gigabit is a bit better of course:

1000Mb / 8 = 125 MegaBytes per second

Assuming your server's hardware can sustain that throughput or more, 
100MB switches with gigabit ports to cascade from the server backbone 
are the most desirable. If your server can definitely sustain better 
than the 125 MBps threshold (and you have load balanced NICs installed), 
it would be beneficial to either place your heaviest users directly on 
your server backbone or to have multiple cascaded switches.

Sherwood Botsford wrote:
> Salman Moghal wrote:
>> I should have kept reading through the samba archive online.  There 
>> was a similar, very recent, reported problem:
>> http://groups.google.com/group/linux.samba/browse_frm/thread/8bf6e9791ae9b3cd/0a038c363be7ba2a#0a038c363be7ba2a 
>> After adding these lines in smb.conf, copying a file over samba share 
>> was lightening fast (just as fast as over FTP/HTTP connection):
>> socket options = TCP_NODELAY
>> oplocks = no
>> level2 oplocks = no
>> My eventual goal is to be able to play mp3 and movies over LAN.  And 
>> I've run into the same problem with streaming a file across (as 
>> mentioned in the thread) -- streaming a file is very choppy.
>> Any ideas?
> IP generally is choppy.  If you want to do this right, I think you 
> need switches that understand quality of service flags -- and then you 
> have to set those on the appropriate packets from your samba server.
> However in many cases the MP3 / Video players have an adjustment for 
> how large a buffer cache to run ahead before starting to play.  Having 
> a buffer  that is sized to be 10-30 seconds of playing time will help 
> a lot for this.
> Also look at your bandwidth.
> Run iostat on your server.  A 100 mbit (fast ethernet) connection 
> typically will get you 3-7 Mbytes per second.  If you're well under 
> this, then the ethernet isn't the bottleneck.  You don't mention if 
> you have gigabit everywhere, and have the ethernet infrastructure to 
> support it.  If you have gigabit to the switch, and fast ethernet to 
> the desktop, you should be able to make streaming video work well.
> You may want to look for specific software to handle streaming -- If 
> you do it as multicast, then multiple users who want the same stream 
> don't tie up your server nearly as much.
> Of course I could be wrong about all this.  Your milage may varry.

More information about the samba mailing list