Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a file server running FreeBSD 4.9 and Samba 2.2.8a. My desktop is Gentoo Linux (Athlon XP 2100, 512Mb RAM), also with Samba 2.2.8a. For some reason, Samba transfer speeds are significantly lower than FTP speeds. For large file writes to the server, I measured 9.49MB/sec with FTP. Samba gets only 2.34MB/sec. Assuming the bottleneck was the CPU, I tested scp. Encrypted transfers were faster than Samba, at 2.73MB/sec! Watching CPU usage in top during a transfer confirmed that the CPU wasn't the bottleneck. So my question is what's wrong with my setup?
I did some performace tuning based on suggestions in the help and Using Samba book. Here's my config file:
[global]
netbios name = BACKUPS
restrict anonymous = Yes
log level = 1
deadtime = 15
socket options = IPTOS_LOWDELAY TCP_NODELAY
write cache size = 285696
[vinum]
path = /var/smb
read only = No
case sensitive = YesThe write cache size is based on my Vinum RAID-0 stripe size of 279k.
I tried Samba 3.0.0, but it was actually slower than 2.2.8.
The connection is routed through only a switch, directly to my desktop, bypassing my router because the server is on my LAN. Both NICs are in full duplex and have 1500 for the MTU.
Also, does anyone know how the number of subdisks impacts Vinum performance? I'm using 1 4Gb drive, 3 8Gb's, and a 20Gb, so I use 4Gb subdisks because they all have to be the same size (greatest common factor). Would I get better performance by removing the 4Gb drive and using 8Gb subdisks?

Somehow, after changing nothing (no intentional changes, at least), I'm suddenly getting more like 3800KB/sec. I still think I should be getting much better, closer to FTP speed, but perhaps I'm starting to pinpoint the problem.
It seems to be more on the client end than the server end because while I know nothing changed on my FreeBSD server, the Gentoo desktop running all the latest software and a 2.6 test kernel could have all sorts of hidden variables. I suppose a good test would be using a different client computer, but that'll take some time to arrange.

Hi Dude,
Its Ok the problem is not with your samba , but is with the cache size. I had a similar problem back a few dayz.
The main reason u use Samba is for file exchange between Unix and windows right??? So just install XceeD client on your windows machine, It willshare all your Unix files as if it were files from a Local Windows server.http://www.hummingbird.com/products/evals/nc/he_form.html
Download it for free and enjoy unlimited access to you rlinux server.
Regards
Sarfaraz

Thanks for the tip about cache size, but I want to share between Linux and FreeBSD. I would use NFS, but I've read Samba actually gives better performance.
What exactly do you mean by cache size? Is it some Samba option I have set wrong or the CPU cache?

I don't have the right answer for you, I
think you know it already by yourself since
you suspect the client (linux side) to give
you some headaches.
- You are running Gentoo on a Celeron-400 /
128 mb and kernel 2.6
It could be samba, could be linux, maybe
both. I think since you've only 128 mb of
ram, if you've a fancy windowmanager like
KDE or Gnome installed, that your memory
could be forming a bottleneck. Since you
encounter a real difference between samba
2.2.28 and 3.0 I'm starting to suspect that
your system is running out of resources.
You have checked your memory usage? (Is
linux accessing the slower SWAP memory?) Or
try doing file transfers without a fancy
windowmanager. (Or best, without graphical
login at all).
By using Gentoo and kernel 2.6; I would
think you have configured your system
"bleeding edge", is it possible that more
safer settings while compiling will create
more stability? By the way I heard that
(test) kernel 2.6 on a single processor
unit still runs slower than a 2.4 kernel.
But a lot of people can tell a lot of
different things and I'm not an expert.
Good luck.

Ooops, sorry, reread your post but your
linux system is not the celeron-400 which
was mentioned at the subject of the post.
Guess system recources should not be the
bottleneck after all.

"Samba transfer speeds are significantly slower than FTP speeds."
"For large file writes to the server, I measured 9.49MB/sec with FTP."
Large files will yield better performance via FTP. There is less overhead in the protocol. This certainly does not account for the discrepancy, though.
"I would use NFS, but I've read Samba actually gives better performance."
I haven't heard of that. I would use NFS too. What I do know is Samba always seems to have performance issues that no one can figure out and go largely undocumented.
Samba has been having performance problems for a little while now. Windows 2k/XP is most noticed (obviously), but FreeBSD had some serious problems a while back (2.0 maybe?) due to some not-entirely-clear issues (i.e. at the time no one had a clue - I am not sure if this has changed).
You have already played with the socket options, so there is not much else network-wise to alter (NIC's are full-duplex - i.e. you checked right?).
Your kernel version could be screwing this up as well, even if it is on the wrong side of the write process. Newer kernels have been known to cause performance problems (even 2.x ones) with Samba.
I would try NFS out. You don't need Samba, and it clearly isn't meeting your needs. Otherwise, you might consider trying a stock Windows machine to attempt to isolate the problem to the server.
"I heard that (test) kernel 2.6 on a single processor unit still runs slower than a 2.4 kernel."
Entirely depends on the the major aspects of the setup.

I tested NFS with a few obvious settings changed for better performance. It turns out Samba, as slow as it is, still easily beats NFS. I was only getting about 1.4MB/sec in NFS.
I also tried Windows 2000 -> Samba and got better than 7MB/sec, suggesting the problem is on the client end. I plan to test the laptop I used for the Windows test in Linux 2.4 and 2.6.
One variable I've noticed is NICs. The server and laptop both have Intel EtherExpress Pro 100s, but the desktop has a 3-Com 3c905. A little googling seems to suggest that between the two, the Intel card is better.

"I tested NFS with a few obvious settings changed for better performance. It turns out Samba, as slow as it is, still easily beats NFS. I was only getting about 1.4MB/sec in NFS."
Something is definitely wrong. It looks fairly clear that the Gentoo client is the problem. Try a 2.4 kernel or 2.6 without the cool new features. Stick with Samba 2.2.x.

With both the client (the laptop that was fast in Windows) and server running Samba 2.2.8a, I was getting 4.3MB/sec in Linux 2.6.0-test11 and 4.2MB/sec in Linux 2.4.22, both kernels built from the unmodified kernel.org releases.
My desktop is also running vanilla 2.6.0-test11. Also worth noting is that I was getting between 6 and 8 MB/sec downloading the big test files on my latop from my desktop. But here's the twist, it was over SSH, while my desktop's CPU was at 100% from compiling stuff, which is also I/O intensive at times. None of my other tests were conducted with the CPU loaded like that. Actually, I didn't intend for those transfers to be tests, but the results are worth noting. If SSH is that fast under such unfavorable conditions, perhaps ~4MB/sec is about all I can expect from Samba.

try changing the media type in ifconfig
ifconfig 100BaseTX or 10BaseT
turning off full duplex worked for me :)

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |