Slow transfer from Linux file server

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ever used netcat?

Try that and see if you can get a baseline for your network and disk performance. That way you can isolate the issue to see if it's Samba or something else. That way you can avoid trying to muck around with tweaking samba if the problem is something else.

Netcat works for both Linux and Windows, but I only have experiance with Linux.

So you have to pick a fairly large file. This is because the Linux kernel does file system caching quite aggressively so you need to have use a file larger then your memory to defeat that.

so.. I am runnign out of tiem right now, but here is teh basics.. on one machine you go:

nc -l -p 8000 > temp

first. Then just leave that running. The on the other machine you go:
time nc remote.machine.address 8000 -q 0 < filename

Then you can also redirect the first command to /dev/null and avoid having disk I/O speed come into it.

It may be that on the upload the file is being saved in cache before being written, so that why it's very fast. Then on the upload it's accessing disk instead of cache which may have a problem and it's being slow.

Then there are a couple other small file system benchmarks and newtork benchmarks you can do, but netcat is pretty easy and quick.

Samba should be between 50-70% of that performance I am guessing.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: fyleow
I have an Ubuntu file server and I'm getting slow transfer speeds when I move files from the file server to my desktop. It goes at around 8 MB/s. This is through dragging and dropping the file from explorer in Windows Vista and XP. At first I thought this might just be an explorer issue so I booted into Ubuntu and tried it there with the same result.

File transfers to the file server are faster though, with speeds reaching around 25MB/s.

The file server has an Athlon 1.6ghz, 512mb, and a RAID 5 array. There's about 200MB of free memory according to top.

top shows about 45% smbd and 15% pdflush cpu usage during transfers to the file server (25MB/s).

top shows about 15% smbd cpu usage during transfers from the file server (8 MB/s).

Do you have any socket options defined under your global settings? You shouldn't. Other than that, there is another thread around here about a known bug still in Vista regarding slow file copies. That may or may not pertain to you. Personally, I tried out Vista for a couple weeks and never noticed any slow performance with moving/copying files, either within Vista, or with my Debian Etch Samba server (this is a 500mhz Celeron with like 64Megs of RAM server).
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: fyleow

Brazen:

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY

Yeah the SO_RCVBUF=8192 SO_SNDBUF=8192 is what I was thinking of. That is very very old documentation leftover from the 2.4 kernel days. On 2.6 kernels, you'll get better performance without it. As for the TCP_NODELAY, that is ok, because TCP_NODELAY should be enabled by default anyway.

Rereading your original post, you say smbd is using 45% of your processor. That seems a little high to me, and now I remember I had a similar problem on an Ubuntu Dapper file server. After rebooting the server, smbd would use like 1% and creep it's way up until it was using 99% and the server would slow to a crawl until I rebooted it again. I never figured out what caused it, I just switched to Debian Etch and the issue never showed up.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Memory usage is difficult to determine in Linux.

It's best to look at it from a few different sources to see what is going on.
One is the /proc/meminfo file
then top is good.

Then free is good also.

I attatched output for 'free' on my system.
The first line shows total used, the second line shows what memory is actively used and adds the buffers and cache to the 'free' collumn.

So I am only realy using 415 megs and nearly 600 megs is files buffers/caches for files and applications.

For comparision here is from top:
Mem: 1028168k total, 1009636k used, 18532k free, 136340k buffers
Swap: 1951888k total, 12348k used, 1939540k free, 447364k cached


I'll see if I can find a bug report or something with Ubuntu and Samba uploads being very slow.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I don't have a lot of experiance with Samba. But here are a couple things I've found so far:

Quick overview of Samba tweaking:
http://www.oreilly.com/catalog/samba/chapter/book/appb_02.html

Try to use:
sudo ifconfig -a
and see if your getting large numbers of RX or TX errors...

Also check the logs and up the log level on the samba configuration to see if anything pops up there.
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
I had this exact same problem a year or two ago with some FC4 machines. I don't remember the remedy (sadly) but it was the EXACT same situation.

Joe
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: fyleow
...If I switched to something like Debian etch?
My problem wasn't exactly like yours, but that is what I eventually did and my problem didn't come back.