Poor samba performance

swank121

Senior member
Nov 15, 2003
252
0
0
I am using an old 600 Mhz Duron with 384MB RAM as a simple file sharing PC on my home network. I have stocked it with about 350GB's of hard drives, and installed Gentoo Linux 1.4. I am seeing some interesting results when using Samba 2.2.8 to transfer files across the network. I have a Linksys 8-port Gigabit switch, with Intel gigabit PCI cards all around. When using FTP to transfer files, I can easily get 180Mbit/sec sustained transfers (about 22MB/sec) .. but when using Samba, performance is much slower at around 120~130Mbit/sec. During Samba transfers, the performance also intermittently spikes down dramatically for a second or two before returning to 120Mbit/sec, as many as 15 spikes a minute. I have tried playing with the socket options within Samba, specifically the SO_SNDBUF and SO_RECBUF but no combination seems to improve performance. I figure the problem is in Samba and not the kernel itself because I get great transfer rates through FTP. I am transferring between Linux and Windows XP machines. Any ideas?
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
That looks normal... FTP is a much leaner protocol than Samba. 180Mbit/s is faster than a HD can write so your memory
buffers are going to become full and that will all have to be committed to disk. What's the CPU usage on the file server
when doing these samba transfers?
 

swank121

Senior member
Nov 15, 2003
252
0
0
CPU usage never tops 40% in Samba .. 20% using FTP. I'm guessing by lean you mean there is less overhead per packet, therefore more throughput. I'm pulling the files from the Samba server onto an SATA RAID array of 7200RPM drives that should be able to write faster than 180Mbit/sec, but I wouldn't be surprised if the older hard drives I used in the server can't *read* any faster. Transfers going the other way are the same speed though (XP->Linux), as are simultaneously transferring two files, one from the master of each ATA controller of the Linux server. In any case, when using the server as I intended (MP3s, movie streaming) the performance is adequate. Just curious if anyone else had noticed this .. the few articles I've read about Samba performance seem to suggest that FTP and Samba should have roughly equal transfer rates.
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
I think that CPU usage stat really shows how much overhead is in the SMB protocol vs FTP :). Twice the CPU utilization to send the same amount of data is quite a bit! I believe Samba 3 is supposed to be much faster. I haven't really tested it though since I have no need for it, since I just use NFS. Well... I have Samba 2 installed for the lone Win98 machine on the network, not sure why though.

You can only write onto that SATA RAID array as fast as the file server can pull the data from it's HD's :) The reason why you see the speeds are are getting though is because almost all file transfer protocols use a lot of buffer. I'm sure before the file starts transfering, Samba, or your FTP serving software has buffered much of the file into memory before transmitting it down the network.

<edit>Nevermind that bit about the pre-buffering... although it might still be correct. I was reading 180Mbps as 180MBps. 22.2MBps may still be pretty high for an old HD though.</edit>
 

swank121

Senior member
Nov 15, 2003
252
0
0
Yeah, I've thought about installing Samba 3. The thought of tearing apart my delicate network after so much work setting it up isn't very appealing though. :)
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
Originally posted by: swank121
Yeah, I've thought about installing Samba 3. The thought of tearing apart my delicate network after so much work setting it up isn't very appealing though. :)

You know... once you've setup something for the first time, it takes no time to set it up the second time! I'm sure it would be worth a try :D

 

skyking

Lifer
Nov 21, 2001
22,705
5,829
146
My server drive died, and my replacement uses samba 3. It was no big deal to transition, the same conf file works, unless you want those extra features available in 3.