Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba Troubles, Slow connections
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Sun Oct 09, 2005 11:45 am    Post subject: Samba Troubles, Slow connections Reply with quote

Here's the problem: I'm trying to stream video from my samba server to my samba client, both are gentoo machines and the connection is just too slow. When a friend was visiting with his laptop (windows), my gentoo client had slow transfers from those shares as well. By slow I am talking about 10-500KB/sec, when with FTP I get 15-20MB/sec. I have a gigabit network, so that is the speed I should be getting from smb as well. I'm able to play xvids and anything smaller than a DVD, I wouldn't really care about getting the maximum speed as long as I'm able to play DVD's as well. Here is a weird thing I've encountered, if when my client tries to play a DVD through the mounted samba share I do other things (like web browsing) that puts a load on the clients ethernet interface.. samba speeds up somewhat. If I keep doing more things to load the network, like repeating a find search in the mounted samba share, the speed could briefly go all the way up to 2MB/sec. Now how weird is that?

Here's what I've tried: Two different 2.6.11 kernels as well as my current 2.6.12.6 patched with reiser4 and vesafb-tng. I can't try any earlier than 2.6.11 because I formatted my root with a 2.6.11 reiser4 enabled kernel. I've tried both "unstable" and "stable" samba, current version is the latest in portage; samba-3.0.14a-r2. I've tried everything from a very basic smb.conf to the one I have now with a lot of different options in it, none of which have helped in the least. I have both smbfs and cifs compiled as modules, both of them has the same slow speed. I've read people suggest removing the socket options, that had no effect. At some point almost everything from this config wasn't there to start with.

Code:
[global]
   interfaces = lo eth0 10.0.0.2/24
   workgroup = WORKGROUP
   netbios name = sir
   hosts allow = 10.0.0. 127.
   max mux = 100
   dns proxy = no
   disable netbios = yes
   local master = no
   ldap ssl = no
   server string = Samba Server %v
   log file = /var/log/samba3/log.%m
   max log size = 50
   map to guest = bad user
   security = user
   encrypt passwords = yes
   smb passwd file = /etc/samba/private/smbpasswd
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   wins support = no
   load printers = no
   disable spoolss = yes
   dead time = 15
   getwd cache = yes
   wide links = no
   read raw = yes
   write raw = yes
   level2 oplocks = true
   oplocks = yes
   max xmit = 65535
[public]
   comment = Public Stuff
   path = /home/ftp
   public = yes
   case sensitive = no
   writable = yes
   browsable = yes
[ftp]
   comment = Public Stuff
   path = /opt/glftpd/site/incoming
   public = yes
   case sensitive = no
   writable = yes
   browsable = yes


So to sum it up, everything in my network except samba is working flawlessly. Suggestions? I've searched the forums to no avail and I seem to be loosing my morale for further fault-seeking/testing.

EDIT: This is laughable really, with a little bash script I'm looping a 'find' inside the samba mount resulting in fully working DVD streaming. Speeds go from approx. 500KB to 10MB while the script runs at the same time as a DVD is played, when there is no DVD played the script only makes up for about 10-100KB bandwidth usage. Why on earth would samba only reach speeds of 1MB++ when I put just a tiny bit more strain on the network..

EDIT: At least this proves that samba is capable of using enough bandwidth to stream DVD's. I'm still looking for better solution than my hack, of course. Any input regarding this would be appreciated, thanks.
Back to top
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Mon Oct 10, 2005 4:47 pm    Post subject: Reply with quote

Some further testing with a samba server at work revealed that my laptop got a more constant 1MB/sec transfer rate as opposed to around 100-500KB/sec at home. I've almost copied that servers smb.conf which didn't help at all, I really doubt it's a conf problem. I think it's either kernel related or maybe samba compile options or what not. The server at work was a 2.6.10 kernel. I would appreciate input from others who run samba on 2.6.12 kernels, fast?, slow? what's your experiences, do you mount with cifs or smbfs? anyone else using samba with reiser4 filesystems?
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Mon Oct 10, 2005 6:32 pm    Post subject: Reply with quote

eonic wrote:
Some further testing with a samba server at work revealed that my laptop got a more constant 1MB/sec transfer rate as opposed to around 100-500KB/sec at home. I've almost copied that servers smb.conf which didn't help at all, I really doubt it's a conf problem. I think it's either kernel related or maybe samba compile options or what not. The server at work was a 2.6.10 kernel. I would appreciate input from others who run samba on 2.6.12 kernels, fast?, slow? what's your experiences, do you mount with cifs or smbfs? anyone else using samba with reiser4 filesystems?


I use Samba at work. The Gentoo server (with kernel 2.6.12-gentoo-r4 at the moment, though it's been running with 2.6.x from 2.6.6 or so... before that it was 2.4.x) is connected to a gigabit network and a Windows box downloads stuff from the server. Speed is around 30 megabytes per second, and the limiting factor seems to be Windows-side, it's DLT box to be more precise. I haven't altered any network related Samba settings.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Mon Oct 10, 2005 7:56 pm    Post subject: Reply with quote

What about a linux client connecting to that server to download stuff? same speeds, same kernel? what about your samba versions and USE flags? Something on either my client or server, maybe even both is weird.
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Tue Oct 11, 2005 7:22 am    Post subject: Reply with quote

Works well in both directions.

[ebuild R ] net-fs/samba-3.0.14a-r2 +acl -cups -doc -kerberos -ldap -libclamav +mysql -oav +pam -postgres +python -quotas +readline (-selinux) -winbind -xml -xml2 17 kB
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Tue Oct 11, 2005 12:29 pm    Post subject: Reply with quote

Maybe it's reiser4's fault, though I fail to see how that could have anything to do with it.. I bet you're not using reiser4 on any of those machines? Is there even anyone at all out there using samba and reiser4?
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Tue Oct 11, 2005 12:35 pm    Post subject: Reply with quote

I'm using ReiserFS v3. I don't know how v4 could affect Samba's performance, at least that much.

Is there some kind of router box at your home between the boxes (yes there is, I'd guess)? Maybe that is the bad guy of this story? Have you tried to connect your laptop directly to your server?
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Tue Oct 11, 2005 12:49 pm    Post subject: Reply with quote

Server and client are on the same subnet, no routing between them. Along with that, ftp connections get speeds in the order of 10-20 megabytes per second. I could try and find a method for playing a dvd directly without mounting the samba share first, just to see if there is a difference.
Back to top
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Mon Oct 17, 2005 11:29 am    Post subject: Reply with quote

Now I've tried using the samba server with a Windows box and it achieved speeds of up to 8 Megabytes per second. Seems like there is something wrong with both the linux client and samba server since the speed should have been around 20 Megabytes per second. This test was still done with the reiser4 filesystem on the samba server, I will try to transfer files from a different filesystem. I really can't pin the problem to anything else other than reiser4, it's the only thing that stands out.. :/ well, we'll see soon enough.
Back to top
View user's profile Send private message
hysteresis
n00b
n00b


Joined: 10 Oct 2005
Posts: 9

PostPosted: Sat Oct 22, 2005 9:35 pm    Post subject: Reply with quote

eonic wrote:
. This test was still done with the reiser4 filesystem on the samba server, I will try to transfer files from a different filesystem.


Just how are you accessing the share? Are you using smbmount? mount? Through a GUI or on a commandline?
What ethernet driver are you using? Since the connection is going only one way -- from the server to the client -- there could be something wrong with the ethernet drivers.

I have encountered a problem when use the smbmount command. My experience is that this command only works with windows shares and not from linux to linux. The mount command seems to work better.
Code:
mount -t cifs //smbserver/user /mnt/shares  -o username=user,password=passwd

Do NOT use -t smbfs when mounting a linux share on a linux machine.

I also found that the the there are some things you need to do in smb.conf
I have not been able to get the mount to recognize symlinks so I turned off
Code:
unix extensions = no

This recognizes every link as a hard link.
look at your socket options.
Code:
socket options  =  TCP_NODELAY  SO_RCVBUF=8192 SO_SNDBUF=8192

You might want to increase the size of the buffers. It maybe that the acknowledgements from the client side are slowing things down. . Also, set
Code:
oplocks = true
Read size =16384

Try looking at your MTU setting on your ifconfig. YOU may be sending smaller chunks.
try
Code:
max xmit = 2048


Set
Code:
strict locking = no
log level = 1


Then try the read raw setting as yes or no and see which one works best.
I would be interested in hearing if there is any improvement with any of these settings. Also, With what and how are you measuring throughput?
Back to top
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Thu Nov 03, 2005 1:44 pm    Post subject: Reply with quote

Sorry for the delayed response, I have been very busy. However, I have been using "mount -t cifs..." just as in your example. As for your suggestions about the smb.conf options, I'll have to try them when I get home later today. I have used bwm-ng, a commandline utility to measure bandwidth throughput. As well as watching dvd's play very badly from a samba share, suggesting an extremely crap throughput.
Back to top
View user's profile Send private message
NightMonkey
Guru
Guru


Joined: 21 Mar 2003
Posts: 351
Location: Philadelphia, PA

PostPosted: Fri Nov 18, 2005 4:39 am    Post subject: Reply with quote

Ah, CIFS doubled my sluggish transfer performance found with SMBFS. Thanks for the info! :) :) :)
_________________
:D
Back to top
View user's profile Send private message
marjue
n00b
n00b


Joined: 26 Sep 2004
Posts: 18

PostPosted: Tue Nov 22, 2005 10:19 am    Post subject: Reply with quote

Hi

I have an equel problem. Ich have Samba 3 on my Gentoo box for a long time. I use it with WinXP clients.
Now i noticed that transfers from the server are very slow (1MBit). Copying to the Server is OK. With FTP i reach 10MB/s.

Now the effect: I run a download with 1MB/s. While downloading i reload the shorewall. During the reload the speed of the download gets much faster. But the shorewall is not the bad guy. When i run the system without any firewall rules the download is slow too. :?:

Now i put the "oplock=no" parameter in my global section and speed went up to ~2-3MB/s. But i thought this parameter has to be on "yes" for better performance ?

I trieed all the smb parameters which are known for better performance but nothing happened.
Back to top
View user's profile Send private message
maudib
n00b
n00b


Joined: 03 Nov 2005
Posts: 50

PostPosted: Thu Dec 01, 2005 4:33 pm    Post subject: Reply with quote

well..i can just confirm the problems...

having mounted samba shares (from a gentoo server) on a gentoo client using cifs, the speed maxes at 8-12Mb/s.
using ftp or nfs i get 25-35Mb/s. also using smbclient is around 30Mb/s.

have tried 3different NICs, netgear and dlink with different drivers but still no good.
Back to top
View user's profile Send private message
marquischan
Tux's lil' helper
Tux's lil' helper


Joined: 19 Mar 2005
Posts: 108

PostPosted: Sat Dec 17, 2005 2:51 am    Post subject: Reply with quote

I am facing the same problem also

my lan card is Realtek 8139

before, tried LevelOne


The speed in FTP is normal but POOR in Samba
Back to top
View user's profile Send private message
Gegolath
n00b
n00b


Joined: 04 Dec 2004
Posts: 10

PostPosted: Sun Dec 18, 2005 11:24 pm    Post subject: Reply with quote

jepp, same Problem here.

Just came out all of the sudden, at least so it seems to me because i don't remember to reconfigured or installed something new or things like that.

I did several hours of testing and came to these results:

- Downloading/Streaming from the Server is slow like an old sleepy tortoise

- Anything except Samba works just fine (FTP, HTTP, NFS ..and so on)

- Linux or Windows as Client doesn't make any difference

- Copying from the Client TO the Server works fine and with full speed

- Taking the Server under Load (Network and/or CPU) moves the bandwith of the download up significant (doing an emerge, or running a find script or something similar...if you suspend the process...bandwith goes down..if you start it again bandwith goes up again...freaking weird?!)

- Recompiling Samba didn't work

- Tried Samba Version 3.0.14a and 3.0.20b with no difference at all

- Tried Kernel 2.6.12-r6 and 2.6.14-r5 with no difference at all

- Doesn't seem to be any Samba configuration behavior


Network Cards are:

Realtek 8169 (Server)
Marvel Yukon/Syskonnect (Client)


Both the Client (runs Windows also) and the Server run on Gentoo

And thats my Samba config, but i think this mysterium is not an config failure
Code:

[global]
        hosts allow = 127.0.0.1 10.12.6.0/24 10.8.0.0/24
        hosts deny = 0.0.0.0/0
        #use sendfile = no
        #security = share
        workgroup = OLYMP.NET
        guest account = gegolath
        server string = Phoenix Samba Server %v
        interfaces = 10.12.6.1/24
        smb passwd file = /var/lib/samba/private/passdb.tdb
        passdb backend = tdbsam
        client NTLMv2 auth = Yes
        client lanman auth = No
        client plaintext auth = No
        #log level = 1 passdb:1 auth:1
        log level = 1
        log file = /var/log/samba/log.%m
        max log size = 50
        name resolve order = host lmhosts bcast
        #time server = Yes
        read raw = yes
        write raw = yes
        getwd cache = yes
        max xmit = 65535
        oplocks = yes
        socket options = IPTOS_LOWDELAY TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
        strict sync = No
        load printers = No
        dns proxy = No
        homedir map =
        create mask = 0744
        directory mask = 0775
        #ClamAV mit Samba verwenden
        #vfs object = vscan-clamav recycle
        #vscan-clamav: config-file = /etc/samba/vscan-clamav.conf
        time server = Yes
[Filme]
        comment = Film Directory
        path = /opt/data2/Filme
        invalid users = root
        valid users = gegolath, cassandra, +users, +smbroot
        read only = No

[Data]
        comment = Fileserver Raid Daten Array
        path = /opt/data
        #guest ok = Yes
        veto files = /postgres/
        veto files = /Squidcache/
        admin users = gegolath
        invalid users = root
        read only = No
[Data3]
        comment = Fileserver Entertainment and Data Drive
        path = /opt/data3
        invalid users = root
        read only = No

[Data2]
        comment = Fileserver Video Media Drive
        path = /opt/data2
        invalid users = root
        read only = No

[Ebooks]
        comment = Fileserver Ebooks
        path = /opt/data/Ebooks
        invalid users = root
        read only = No

[Mp3s]
        comment = Fileserver Audio Files
        path = /opt/data/Audio
        invalid users = root
        read only = No

#[printer]
#       path = /dev/null
#       browseable = No
#       available = No


I hope somebody has the luck and the wisdom to reveal this enigma

At the moment I'am trying to recompile my glibc and then samba again...maybe this does the trick...i will let you folks know if it does change anything.
Back to top
View user's profile Send private message
dspgen
Tux's lil' helper
Tux's lil' helper


Joined: 17 Aug 2005
Posts: 103

PostPosted: Tue Jan 10, 2006 2:29 am    Post subject: Reply with quote

Same issue. Here are my test results

3 computers:
"S1" = Windows 2000 server
"C1" = 2.6.14-gentoo-r5 (k8 cpu)
"C2" = 2.6.14-gentoo-r5 (i686 cpu)

speed tests: (589MB file, determined by "date && copy x && date")

"C1" (NFS) from "C2" gets 15MB/s
"C1" (smbclient) from "C2" gets 27MB/s
"C1" (mount -smbfs) from "C2" gets 12MB/s

"C1" (smbclient) from "S1" gets 24MB/s
"C1" (mount -smbfs) from "S1" gets 0.185MB/s

"C2" (smbclinet) from "S1" gets 21MB/s
"C2" (mount -smbfs) from "S1" gets 9MB/s

"C1" (mount -smbfs) to "S1" gets 13MB/s



clearly there is something special about C1 :(

edit:

Tried using the kernel from "C2" on "C1", increased the speed to ~1MB/s.

switched to cifs:

"C1" (mount -cifs) from "S1" gets 13MB/s
Back to top
View user's profile Send private message
dspgen
Tux's lil' helper
Tux's lil' helper


Joined: 17 Aug 2005
Posts: 103

PostPosted: Mon Jan 23, 2006 9:24 pm    Post subject: Reply with quote

Now I have a problem with a WinXP client.
gentoo has DVD vob files on its hard disk. when copying the vob files to another drive on that computer it get 30-40MB/s.

watching this DVD (via samba) it plays fine for a while. copying the a vob files get like 16MB/s.
After some time (2-10 hours after boot), the network connection slows to 10-300KB/s.

Reboot, and it works fine for a while again.

when it is going slow, I can smbclient to the WinXP and copy from WinXP at 5.5MB/s.

after rebooting (when it is going fast), smbclient to the WinXP and copy from WinXP gets 24MB/s
on the WinXP, copying a vob from the gentoo gets 19MB/s

Code:
ifconfig eth0 down && sleep 30 && ifconfig eth0 up

does not fix the problem. rebooting does.

Anyone have any ideas or other tests, logs, etc to look at?
Back to top
View user's profile Send private message
dspgen
Tux's lil' helper
Tux's lil' helper


Joined: 17 Aug 2005
Posts: 103

PostPosted: Fri Jan 27, 2006 7:48 am    Post subject: Reply with quote

No one? no ideas on why network shares get slow after a while? please?
Back to top
View user's profile Send private message
Merlin-TC
l33t
l33t


Joined: 16 May 2003
Posts: 603
Location: Germany

PostPosted: Fri Apr 28, 2006 11:20 pm    Post subject: Reply with quote

Any news here? I am having exactly the same problem. FTP transfers and all other network related things work fine just samba transfers FROM the server to a client are very slow ~1mb/s while uploading to the server is fine.
Back to top
View user's profile Send private message
dspgen
Tux's lil' helper
Tux's lil' helper


Joined: 17 Aug 2005
Posts: 103

PostPosted: Sat Apr 29, 2006 2:12 pm    Post subject: Reply with quote

I've had no problems since I replaced my network switch & cables (doh! I was using cat-5 with a gigabit switch - I replaced all my cables with new cat-6's) - strange that only samba had problems with the old switch/cables.
Back to top
View user's profile Send private message
Merlin-TC
l33t
l33t


Joined: 16 May 2003
Posts: 603
Location: Germany

PostPosted: Sat Apr 29, 2006 3:10 pm    Post subject: Reply with quote

Well I am only running a 100mbit network but I only get max 1mb/s when downloading from the server. I have another switch so I might give that a try.
Back to top
View user's profile Send private message
andrewwalker27
l33t
l33t


Joined: 27 Jun 2005
Posts: 660

PostPosted: Sun Jun 18, 2006 10:42 am    Post subject: Reply with quote

Same problem here, I'm only managing 300K/Bs which is rather painful when you're trying to transfer a video file across! I'm using ~x86_64
Back to top
View user's profile Send private message
Dgege
n00b
n00b


Joined: 14 Jun 2004
Posts: 59

PostPosted: Sat Jul 01, 2006 6:30 pm    Post subject: Reply with quote

I'm having exactly the same problem ! Everything works but samba. From client to server, I get good speeds. But from server to client, it's slooooooooooooow. I tried other distros (debian, suse) and I get the same problem ! I don't get it. I don't have much time right now, i'm finishing my masters. Once it's done, I'll trouble shoot, hopefully getting to the bottom of it !

Georges.
Back to top
View user's profile Send private message
Dgege
n00b
n00b


Joined: 14 Jun 2004
Posts: 59

PostPosted: Sun Jul 02, 2006 11:38 pm    Post subject: Reply with quote

ok guys, I think I narrowed down the problem to the network card. To everyone who is experience this problem, what network card module are you using ? I'm using via-rhine, which I suspect is the culprit.

Dgege.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum