LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Extremly Slow Samba (https://www.linuxquestions.org/questions/linux-server-73/extremly-slow-samba-536370/)

aripari 03-10-2007 04:36 PM

Extremly Slow Samba
 
Hi,

I have installed the Mandriva 2007 with the original Samba server package and my problem is that it works very very slow from my windows XP. The connection works fine but is very slow.

When i Browse my shared folders it takes forever to open directories and even longer to open textfiles. I tried to watch a movie to and the movie was stopping the whole time.

Has anyone any idea what it could be that causes this?

/aripari

Electro 03-10-2007 05:33 PM

Start reading the manual. Also invest time to find the optimal format options for the desire filesystem. I use XFS, so SAMBA works as fast as Windows. A 100 Mb network can not transfer more than 12 megabytes per second. If you have a 1 Gb network, the throughput will depend on the hard drive throughput, the bus speed, and hub or switch that is used. A firewall can also limit the throughput and the reliability of the connection.

I suggest not using Mandriva because it has too many loose screws.

aripari 03-11-2007 04:12 PM

Is there anyway to reformat the disk without reinstalling Linux?

Electro 03-11-2007 06:40 PM

Get another hard drive that is equal or greater than the data that is taken up. Copy the data and format the partitions. Then copy the files back on the drive. Re-installing Linux is ridiculous.

teeks99 04-26-2007 12:53 PM

I'm having the same issue using Ubuntu.

I have a brand new machine running Feisty (Dual core chip, 4gb ram, 1gbps Ethernet). I have set it up for both Samba shares and FTP connections on my local LAN.

The problem is: I can transfer a 1GB file in under two minutes over FTP, but when I try to transfer the exact same file between the same two computers over samba it takes ~120 minutes. Is there anything I need to check in my configuration off the bat?

I have done:
Ubuntu (server) -> Windows
Ubuntu (server) -> Fedora Core 5 smbclient

Both run at the same, very slow, rate.

This is only a problem when downloading from the server. File transfers back to ubuntu run fine.
Windows -> Ubuntu (server) -- full speed

I feel like it is a configuration issue, since more people haven't noticed this problem. I've tried playing around iwth the socket options line, with the following options set:

#socket options = TCP_NODELAY
socket options = TCP_NODELAY
socket options = IPTOS_LOWDELAY TCP_NODELAY
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

There's not really any relevant stuff that I could see in the logs. No errors stuck out.

Any ideas and I'd be greatful!
Thanks,
Tom

Electro 04-27-2007 12:38 AM

I use the following line and it has equal performance like computer's running Windows.
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384

The filesystem that I use is XFS. I am using 100 Mb network, so the throughput is only around ten megabytes per second. Though I do have a 1 Gb Realtek model 8169 that I thought it will be slower (higher latency) compared to the Linksys 100 Mb card. The time it takes to copy from or to SAMBA to another computer running either Linux or Windows is the same amount of time it takes two computers using Windows to transfer a gigabyte file. The hard drive brands that I use is Hitachi/IBM and Western Digital.

The cause of slow performance is the network parameters for the kernel, SAMBA configuration, network security, and firewall. SAMBA needs four ports open such as 137, 138, 139, 445. I suggest increase the log level for SAMBA to get more information what it is actually doing.

teeks99 04-27-2007 08:55 AM

I'm not too worried about the file system. I've got ext3, but even better, when I do an FTP transfer of the exact same file, it doesn't have the problem (and goes approx 100x faster for large files).

I added the changes to SO_RCVBUF SO_SNDBUF but they didn't seem to do anything. I think they are simply performance tweaks.....I'm looking for a serious performance bug -- two orders of magnitude in speed.

I can only assume that if any connection is going through, the necessary ports are working. Is there a good way to check this?

Here's a rundown of what happens in the logs. I have:
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
log level = 2

sudo /etc/init.d/samba restart

log.smbd
Code:

[2007/04/27 03:27:11, 0] smbd/server.c:main(847)
  smbd version 3.0.24 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2006
[2007/04/27 03:27:11, 2] param/loadparm.c:do_section(3712)
  Processing section "[homes]"
[2007/04/27 03:27:11, 2] param/loadparm.c:do_section(3712)
  Processing section "[printers]"
[2007/04/27 03:27:11, 2] param/loadparm.c:do_section(3712)
  Processing section "[print$]"
[2007/04/27 03:27:11, 2] param/loadparm.c:do_section(3712)
  Processing section "[fs]"
[2007/04/27 03:27:11, 2] lib/interface.c:add_interface(81)
  added interface ip=192.168.0.207 bcast=192.168.0.255 nmask=255.255.255.0
[2007/04/27 03:27:11, 2] lib/tallocmsg.c:register_msg_pool_usage(61)
  Registered MSG_REQ_POOL_USAGE
[2007/04/27 03:27:11, 2] lib/dmallocmsg.c:register_dmalloc_msgs(71)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2007/04/27 03:27:11, 2] smbd/server.c:open_sockets_smbd(384)
  waiting for a connection

log.nmbd
Code:

[2007/04/27 03:27:11, 0] nmbd/nmbd.c:main(699)
  Netbios nameserver version 3.0.24 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2006
[2007/04/27 03:27:11, 2] nmbd/nmbd.c:main(723)
  Becoming a daemon.
[2007/04/27 03:27:11, 2] lib/tallocmsg.c:register_msg_pool_usage(61)
  Registered MSG_REQ_POOL_USAGE
[2007/04/27 03:27:11, 2] lib/dmallocmsg.c:register_dmalloc_msgs(71)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2007/04/27 03:27:11, 2] lib/interface.c:add_interface(81)
  added interface ip=192.168.0.207 bcast=192.168.0.255 nmask=255.255.255.0
[2007/04/27 03:27:11, 2] nmbd/nmbd_subnetdb.c:make_subnet(144)
  making subnet name:192.168.0.207 Broadcast address:192.168.0.255 Subnet mask:255.255.255.0
[2007/04/27 03:27:11, 2] nmbd/nmbd_subnetdb.c:make_subnet(144)
  making subnet name:UNICAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
[2007/04/27 03:27:11, 2] nmbd/nmbd_subnetdb.c:make_subnet(144)
  making subnet name:REMOTE_BROADCAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
[2007/04/27 03:27:11, 2] nmbd/nmbd_lmhosts.c:load_lmhosts_file(41)
  load_lmhosts_file: Can't open lmhosts file /etc/samba/lmhosts. Error was No such file or directory

Open windows explorer, go to \\client\share

log.smbd
Code:

nothing new
log.nmbd
Code:

nothing new
log.192.168.0.xxx
Code:

[2007/04/27 03:28:51, 2] smbd/reply.c:reply_special(496)
  netbios connect: name1=MYHOSTNAME            name2=MYCLIENTNAME         
[2007/04/27 03:28:51, 2] smbd/reply.c:reply_special(503)
  netbios connect: local=myhostname remote=myclientname, name type = 0
[2007/04/27 03:28:51, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:28:51, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.

log.myclientname
Code:

[2007/04/27 03:28:51, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [myusername] -> [myusername] -> [myusername] succeeded
[2007/04/27 03:28:51, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving IPC$ as a Dfs root
[2007/04/27 03:28:51, 1] smbd/service.c:make_connection_snum(950)
  myclientname (192.168.0.202) connect to service fs initially as user myusername (uid=1000, gid=1000) (pid 15500)
[2007/04/27 03:28:51, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving fs as a Dfs root
[2007/04/27 03:29:01, 1] smbd/service.c:close_cnum(1150)
  myclientname (192.168.0.202) closed connection to service fs

Successful File Copy
File Size 8mb - takes 30sec instead of less than 5

log.smbd
Code:

nothing new
log.nmbd
Code:

nothing new
log.192.168.0.xxx
Code:

(continueing after what was shown above)
[2007/04/27 03:29:54, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:29:54, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:15, 2] smbd/reply.c:reply_special(496)
  netbios connect: name1=MYHOSTNAME            name2=MYCLIENTNAME         
[2007/04/27 03:30:15, 2] smbd/reply.c:reply_special(503)
  netbios connect: local=myhostname remote=myclientname, name type = 0
[2007/04/27 03:30:15, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/reply.c:reply_special(496)
  netbios connect: name1=MYHOSTNAME            name2=MYCLIENTNAME         
[2007/04/27 03:30:16, 2] smbd/reply.c:reply_special(503)
  netbios connect: local=myhostname remote=myclientname, name type = 0
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.
[2007/04/27 03:30:16, 2] smbd/sesssetup.c:setup_new_vc_session(799)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old resources.

log.myclientname
Code:

(continueing after what was shown above)
[2007/04/27 03:29:54, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [myusername] -> [myusername] -> [myusername] succeeded
[2007/04/27 03:29:54, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving IPC$ as a Dfs root
[2007/04/27 03:30:16, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [myusername] -> [myusername] -> [myusername] succeeded
[2007/04/27 03:30:16, 1] smbd/service.c:make_connection_snum(950)
  myclientname (192.168.0.202) connect to service fs initially as user myusername (uid=1000, gid=1000) (pid 15569)
[2007/04/27 03:30:16, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving fs as a Dfs root
[2007/04/27 03:30:16, 1] smbd/service.c:close_cnum(1150)
  myclientname (192.168.0.202) closed connection to service fs
[2007/04/27 03:30:16, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [myusername] -> [myusername] -> [myusername] succeeded
[2007/04/27 03:30:16, 1] smbd/service.c:make_connection_snum(950)
  myclientname (192.168.0.202) connect to service fs initially as user myusername (uid=1000, gid=1000) (pid 15571)
[2007/04/27 03:30:16, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving fs as a Dfs root
[2007/04/27 03:30:16, 1] smbd/service.c:close_cnum(1150)
  myclientname (192.168.0.202) closed connection to service fs
[2007/04/27 03:30:16, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [myusername] -> [myusername] -> [myusername] succeeded
[2007/04/27 03:30:16, 1] smbd/service.c:make_connection_snum(950)
  myclientname (192.168.0.202) connect to service fs initially as user myusername (uid=1000, gid=1000) (pid 15572)
[2007/04/27 03:30:16, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving fs as a Dfs root
[2007/04/27 03:30:16, 1] smbd/service.c:close_cnum(1150)
  myclientname (192.168.0.202) closed connection to service fs
[2007/04/27 03:30:16, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [myusername] -> [myusername] -> [myusername] succeeded
[2007/04/27 03:30:16, 1] smbd/service.c:make_connection_snum(950)
  myclientname (192.168.0.202) connect to service fs initially as user myusername (uid=1000, gid=1000) (pid 15573)
[2007/04/27 03:30:16, 2] smbd/reply.c:reply_tcon_and_X(711)
  Serving fs as a Dfs root
[2007/04/27 03:31:14, 2] smbd/open.c:open_file(352)
  myusername opened file Casts/truthhappens.ogg read=Yes write=No (numopen=2)
[2007/04/27 03:31:14, 2] smbd/close.c:close_normal_file(344)
  myusername closed file Casts/truthhappens.ogg (numopen=1)
[2007/04/27 03:31:14, 2] smbd/open.c:open_file(352)
  myusername opened file Casts/truthhappens.ogg read=Yes write=No (numopen=2)
[2007/04/27 03:31:15, 2] smbd/open.c:open_file(352)
  myusername opened file Casts/PodsafeforPeace-IfEveryDayWereChristmas.zip read=No write=No (numopen=3)
[2007/04/27 03:31:15, 2] smbd/close.c:close_normal_file(344)
  myusername closed file Casts/PodsafeforPeace-IfEveryDayWereChristmas.zip (numopen=2)
[2007/04/27 03:31:18, 2] smbd/close.c:close_normal_file(344)
  myusername closed file Casts/truthhappens.ogg (numopen=1)
[2007/04/27 03:31:18, 2] smbd/open.c:open_file(352)
  myusername opened file Casts/truthhappens.ogg read=Yes write=No (numopen=2)
[2007/04/27 03:31:18, 2] smbd/close.c:close_normal_file(344)
  myusername closed file Casts/truthhappens.ogg (numopen=1)
[2007/04/27 03:31:18, 2] smbd/open.c:open_file(352)
  myusername opened file Casts/truthhappens.ogg read=Yes write=No (numopen=2)
[2007/04/27 03:32:28, 2] smbd/close.c:close_normal_file(344)
  myusername closed file Casts/truthhappens.ogg (numopen=1)


Electro 04-27-2007 11:29 AM

If the SAMBA version that you are using now has the same problems with other Ubuntu users, I suggest complaining to the maintainer that creates pre-compile deb packages. If you want, try compile samba. Include the async option. EXT3 has poor throughput for large files. You can keep on trying increase the buffer for SAMBA until performance improves for large file writing and reading.

My SAMBA version is 3.0.22 and it is compiled by using Gentoo's utilities.

teeks99 04-27-2007 12:42 PM

I don't think this is an EXT3 issue, because, as I said, I get MUCH faster transfer speeds using ftp, same file, same filesystem. The only thing I can imagine is that SAMBA makes fs specific calls, and doesn't do them well for EXT3, but then we would have seen this many times before.

I may try a samba compile, hopefully I'll have some time to look at this over the weekend.

Mayne 05-07-2008 01:10 PM

Just for the record, I got very weird behaviour with a Realtek 8169 here.

Samba server uses a RTL8111/8168B PCI Express Gigabit Ethernet controller.
Samba client uses RTL8169S PCI Gigabit Ethernet controller.

Sambla client uses CIFS.

Samba client to server is reasonably fast (>20MBytes/Sec).
Samba server to client is very slow (<2MByte/Sec!).

The interesting thing: scp is fast (>20MBytes/Sec) in both directions.
No trouble listed in logs or ifconfig.
Playing with ethtool offload options didn't change anything.
Playing with Samba server options didn't change anything.
Using the vendor driver for R8169 on the client didn't change anything.
Replacing the network card on the client fixed the issue immediately.

I wouldn't believe this if someone told me but this really seems to be some odd quirk with Samba (NOT other progs) and the R8169 network card. Possibly other hardware is involved here, too - using a SiS 746-based mainboard on the client.

aripari 05-15-2008 05:18 PM

Quote:

Originally Posted by Mayne (Post 3145912)
Just for the record, I got very weird behaviour with a Realtek 8169 here.

I wouldn't believe this if someone told me but this really seems to be some odd quirk with Samba (NOT other progs) and the R8169 network card. Possibly other hardware is involved here, too - using a SiS 746-based mainboard on the client.

I think I have the same Realtek Network Card and I resolved the problem by installing a new Network Card. My Ubuntu did not have the correct drivers for the network card and there for I got slow transfer speeds. But now with a 1000Mb D-Link Ethernet Card and Cat 6 Cables I get pretty god, still not optimal, results but it's enough for me and my Lan.

/Aripari

fuzzix 05-26-2008 06:23 AM

Hi all.

I encountered this problem myself on a new client (Slackware rather than XP...) with (you guessed it) an on-board Realtek card:

Code:

$ lspci
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)

Transfer speeds from my Samba server were ~512kbps rather than the (up to) 100Mbps I was expecting. Just as an experiment I tried using cifs to mount the server's share rather than smbfs;

Old /etc/fstab entry
Code:

//SERVER/homes /mnt/smb smbfs username=user,password=pass,fmask=0644,dmask=0755 0 0
New /etc/fstab entry
Code:

//192.168.0.22/homes /mnt/smb cifs username=user,password=pass,file_mode=0644,dir_mode=0755 0 0
(A hosts file entry for your server would be tidier here...)

That seemed to ramp up the pace nicely - getting around 7-8 MB/sec now (reported by mc). Hopefully this helps somebody.

Electro 05-26-2008 08:23 PM

I have Realtek 8169 gigabit NIC on a PCI Gigabit NIC/USB 2.0/IEEE-1394 combo card hooked up to a HINT Technologies PCI-PCI bridge, then hooked up to an Intel 82801BA, next hooked up to a Intel 82850, and finally hooked up to a 400 MHz quad-pumped bus being shared with RAMBUS memory. On my 100 megabit network and with a dying hub (not switch), I get close to 8 megabytes per second. I normally use smbfs. If I do get a 1 gigabit switch, I do not expect anything higher than 66 MB per second in full duplex mode.

PCI can not transfer 133 MB per second in full duplex mode because there is not enough bandwidth. In order to get 133 MB per second in full duplex mode, it will need a bus that can handle 266 MB per second.

I never use midnight commander or mc to calculate the throughput. I use time with cp. Then I calculate the throughput afterwards using the time and file size. IMHO, the best way to test for network throughput is a file from a server and piping it to null on the client side.

The selection of a file system matters how much throughput you want to read and write. XFS and JFS are high throughput file systems and they fight for 2nd best for reliability. EXT2/3 are low throughput file systems, but it is the most reliable. ReiserFS has poor throughput and poor reliability.

In order to handle 133 MB per second, you will need to put at least four hard drives in RAID-0 (stripping). The worst of conditions, you will need eight hard drives in RAID-0.

Mayne 05-28-2008 12:21 PM

Own reply to posting 10 ;-):
The Samba issue with RTL8169S-based PCI cards has also been mentioned in the current c't magazine (issue 12/2008, page 158 - german). Interestingly, the issue comes up only in the measurements table and not in the actual article text. In the table, other PCI cards transfer about 50MBytes/Sec, but for the RTL8169 card no speed is given - instead a footnote states measured speed was <5MBits in test runs. Probably they couldn't make sense of that behaviour either ;-).

I wonder why such a thing can happen. It's not like RTL8169-based cards and Samba servers are that rare...

rayfward 10-02-2010 07:42 AM

Slow samba
 
1 Attachment(s)
Did anybody get to the bottom of this?
Samba Version 3.5.5-68.fc13
I have the same problem but slower still.
Samba used to be so quick.

Regards

dlugasx 10-04-2010 06:54 AM

This is a problem with finding proper netbios name. Thats why is so slow.

First check Your netbios name.

in my case it is:

Code:

[root@b1 ~]
In /etc/smb.conf in section [global]

addopt this line

Code:

netbios name = b1
Ofcourse instead of b1 please put Your netbios name.

Please do not forget to put the same name in URL (this is important!! )

\\b1\public\



Samba is not slow and doesnt need extremly fast hardware. It needs proper configuration. Here You have example of perfect working configuration.


Code:

[global]
  workgroup = BGROUP
  interfaces = 192.168.1.34 127.0.0.1 eth1
  server string = NewFileServer
#  bind interfaces only = true
  netbios name = b1
  security = user
  encrypt passwords = yes
  smb passwd file = /etc/samba/smbpasswd
  writable = Yes
  inherit permissions = Yes
  name resolve order = lmhosts host wins bcast


[homes]
  comment = Home Directories
  valid users = %S
  browseable = Yes
  read only = No
[public]
  comment = shared zone
  path = /home/share-zone
  writeable = Yes
  create mode = 0775
  inherit permissions = No
  writable = Yes


rayfward 10-05-2010 03:26 AM

Thanks for the reply.
About 6 years ago I had a FreeBSD samba server and the speed was impressive especially with media files.
It's such a long time since set one of these up that I opted to use the "Samba Server Configuration tool" which left out the NetBios name.
I think I'm going to go back and do this the old fashioned way.

Regards.

Ray

jstaffon 01-29-2011 10:31 PM

I hope so because my problem is even a weirder issue.....

Machine 1: Ubuntu 10.04
Machine 2: Suse 11.3
Machine 3: FreeNAS (FreeBSD 7.3)

Samba transfers across a gigabit link:
Machine 1 -> Machine 2 : 300 Mb/s
Machine 2 -> Machine 3 : 300 Mb/s
Machine 1 -> Machine 3 : 10 Mb/s

All three systems have the same version of Samba and socket options = TCP_NODELAY with receive and transmit windows at 64240.

I don't believe it's the network or the NIC because I can mount the file system from Machine 3 onto Machine 1 and get 300 Mb/s.

This is so strange!!
jeff.

rayfward 01-30-2011 11:56 AM

When I first asked about speed issues I was using system-config-samba to configure samba with mixed results.
I consider the issue as resolved because of the following lines.

workgroup = BGROUP
server string = NewFileServer
netbios name = b1

They are significant but they don't seem to be managed by some of the configuration tools. I manualy edited the config file and Tada works fine now.

Oh by the way. Well done with the base config dlugasx. It works a treat.
jstaffon I think you will probably need to take another look at your smb.conf and leave the configuration tools alone.

I would wish you luck but I don't think you will need it.

Regards

jstaffon 01-30-2011 05:42 PM

Thanks for the reminder about the config tools. I always configure the smb.conf with vi but in the case of the machine in question, I've just tweaked the original config file. I think I'll strip out all of the crap thats commented out and not necessary. A smaller, simplified config file is always better. Great idea! Thanks.

bartman2589 03-01-2011 02:41 AM

Samba itself isn't necessarily to blame, I had a 550mb file I needed to transfer from my Kubuntu system (a fresh install of Kubuntu 10.10 Maverick less than a week old, but with all updates installed) to my Windows XP system and when I initially started the transfer the time was reported at about 2 hours, even after letting it go for a few seconds it still was reported at around 1 hour and 50 seconds. I've done transfers around this size from Windows to Windows systems and usually it takes around 10 minutes or so (depending on whether I'm surfing the web at the same time or not), so I knew something was really screwed up here. I had been originally using the onboard VIA 6103 NIC ,which was giving me excellent torrent download results and excellent web download results as well, but I decided to try some of the other PCI bus NIC cards I had lying around. Below are the results I obtained with each card WITHOUT modifying my samba configuration at all.
1) Linksys LNE-100TX Ver. 5.1 - Transfer reported approximate time at about the same as VIA 6103
2) D-Link DFE-530TX+ Rev-F1 - Again almost the exact same results as the VIA 6103
3) Unbranded card with MX98713FC Chipset - Caused system to hang a few seconds into transfer
4) 3Com 3C905B (tried and true card supported by pretty much every PC operating system in the world) - knocked about 10 seconds off the reported transfer rate.
5) Unbranded RTL8139D Chipset based card - Apparently not supported by Kubuntu for some reason or bad card.
6) Farallon RTL8139C Chipset based card - Transfer time dropped to about 7 Minutes instead of around 2 hours!!!!
AFIK all of these cards are 10/100 cards, the 3Com, Linksys, D-Link and MX98713FC based card are definitely supposed to be capable of 100mbs connections, as is the Farallon card (indicated by the presence of a 100mbs indicator LED on some of them).

To me this indicates a pretty serious problem with the default configuration of a number of the kernel modules/drivers/etc.. that are used to support some of the cards above, it's pretty sad when a generic cheapo RTL8139C based card can blow some of those other major brand name cards out of the water the way it did.

The specs of the system I did this on are as follows:
CPU: AMD Athlon XP 2400+ w/266mhz FSB
MB: DFI KT-600AL
RAM: 1.5Gb PC3200 (DDR-400) running at 400mhz
Video: nVidia MX-4000 PCI card w/128mb memory
Audio: Onboard VIA 8237 integrated audio
HD: 160Gb Western Digital IDE (PATA) hard drive UDMA5
DVD: Samsung SH-S222A 22X DVD burner

I admit this was by no means a scientifically conducted test but the results do seem to speak for themselves indicating a problem with the default configuration of the various kernel modules.

SergioRuiz 03-03-2011 05:04 PM

Hi there,

Someone else here with the same issue... In my case I have a RTL 8139.

I'm trying to move files from a hard disk connected to a media server (WD TV Live) to an Ubuntu box. I also have the speed issue, usually less than 1 MB/s.

The thing is that if I move more than one file at the same time, I get a much higher speed. So it seems like the limitation is at one file at the time.

I have changed the samba conf file as pointed out, but in my case it does not apply, as I'm using smbclient... any hints? (samba config on the server cannot be modified, in any case, from a windows box it goes pretty fast).

Thanks!

Sergio

samtoddler 09-27-2011 03:19 AM

Extremly Slow Samba
 
Hi,

Its a bug in ubuntu.
you can check it out here

https://bugs.launchpad.net/ubuntu/+s...mba/+bug/84782

samtoddler

xamfap 01-31-2012 08:58 AM

I cannot post URLs since this I am new. Shame. Google "samba performance" and read up on how to tune samba.

For ubuntu 10 or 11 I suggest:

socket options = TCP_NODELAY
write_raw = no
read_raw = no

read/write_raw may make things worse. It depends how fast your network is compared to the servers HDD and how much "risk" you are willing to take. For example, I use them for a server with a huge RAID that has 8GB of memory and is backed up with UPS.

UbuntuLove 01-06-2013 12:50 PM

Ubuntu 12.10 server with OS X 10.7 client
 
I'm running ubuntu 12.10 and was connecting to samba share with MBPro 10.7 (os x) and experiencing a max transfer rate of 80/kps, suuuuuuuper slooooooow.

After reading endless posts on the matter and trying all sorts of other clients to connect with (as well as servers) none of them were anything like the native smb connection on os x (command K to connect to server) transfer rate i had with ubuntu 11.10.

My socket options for this uber fast transfer rate with my 11.04 smb server were as such:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192


I've been using this setting for about 5 years across multiple server installs so one would think it'd be just fine for ubuntu 12.10 .... wrong! fortunately I came across this thread bc 1 simple change fixed it for me.

My new socket options in my smb.conf on ubuntu 12.10 are now as such:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=16384 SO_SNDBUF=16384


bla dow! uber fast once again - MASSIVE PROPS ELECTRO! TY :)


All times are GMT -5. The time now is 02:54 PM.