# slow samba transfers

## jeezus84

Hiya.

I'm having a speed problem with samba on one of my gentoo boxes. I set up a share but it takes an incredibly long time to transfer files to the gentoo box from windows. Getting files from this box is speedy, but it is hell trying to send stuff to it.

This is strange because I also have an Xbox running Gentoox, and I set up a samba share on that machine using almost the same smb.conf file from my slow box. When I try to send files to the xbox it is really speedy.

So, what's the deal?

Xbox Gentoox smb.conf

```

root@ElBoxo htdocs # cat /etc/samba/smb.conf

[global]

server string = xBox on the speaker

log file = /var/log/samba/log.%m

max log size = 1000

interface = lo eth0

bind interfaces only = yes

security = user

guest ok = no

socket options = TCP_NODELAY SO_RCVBUG=8192 SO_SNDBUF=8192

[downloads]

comment = Put Downloads Here

create mask = 766

path = /home/jeezus84/downloads/

read only = no

valid users = jeezus84

public = no

browseable = yes

[htdocs]

comment = the web server root directory

create mask = 766

path = /var/www/localhost/htdocs/

read only = no

valid users = jeezus84

public = no

browseable = yes

root@ElBoxo htdocs #

```

Slow Gentoo box:

```

jeezus84@underMyDesk ~ $ cat /etc/samba/smb.conf

[global]

server string = The Box Under My Desk

log file = /var/log/samba/log.%m

max log size = 100

interface = lo eth0

bind interfaces only = yes

security = user

guest ok = yes

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

guest account = guest

[theVault]

comment = File Repository

create mask = 766

path = /mnt/theVault/

read only = no

valid users = jeezus84

public = no

browseable = yes

jeezus84@underMyDesk ~ $

```

----------

## Crisis

Try removing this from your gentoo box:

```
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 
```

Not sure if it is a typo here or in the config files, but I notice on your xbox you have it spelled "BUG" so maybe it's actually being ignored on the xbox.

----------

## jeezus84

nope, no dice. here is my new smb.conf for the slow box. things are still crawling.

```

underMyDesk jeezus84 # cat /etc/samba/smb.conf

[global]

server string = The Box Under My Desk

log file = /var/log/samba/log.%m

max log size = 100

interface = lo eth0

bind interfaces only = yes

security = user

guest ok = yes

#socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

guest account = guest

[theVault]

comment = File Repository

create mask = 766

path = /mnt/theVault/

read only = no

valid users = jeezus84

public = no

browseable = yes

underMyDesk jeezus84 #

```

I also removed that same line from the smb.conf on the xbox, and the transfers are still speedy. So, what to do about the slow gentoo box?

----------

## beandog

Are you mounting the shares using SMB or CIFS?  I'd recommend CIFS if you aren't, as it might be a bit speedier.

----------

## jeezus84

well, i'm not sure. Keep in mind the shares are sitting on gentoo boxes, and I'm mounting them with windows (Network Places).

----------

## beandog

Well if youre using Windows 2000 or newer, disable SMB in the kernel network file systems, and use CIFS in its place.

----------

## jeezus84

i'm using windows XP SP2. So I recompiled the kernel, making sure to leave smb out of the kernel and compile in only cifs as a module. I added cifs to the modules.autoload.d file, and it loads with no problems. I am still getting the same transfer rate though.

```

underMyDesk ~ # lsmod

cifs                  194156  0

```

so... I dunno. Is there anything i'm doing wrong?

----------

## beandog

So, copying files from Windows -> Gentoo's samba share is slow, but not the other way around.  Am I reading that first post right?

whats the transfer rate you're getting?  See if FTP is any faster (not sftp) from windows to gentoo.

----------

## ter_roshak

Are you using wireless on any of these boxes?  Are they all on the same type of medium?  I've had some pretty significant slow-downs when using 802.11b wireless when loading roaming profiles when compared to wired ethernet.

----------

## jeezus84

actually, yes for the wireless. The path is from my laptop (802.11g) to the router (802.11g) to a 10/100 switch to the slow box, and the same path to the fast box. They're both on the same switch.

----------

## ter_roshak

 *jeezus84 wrote:*   

> actually, yes for the wireless. The path is from my laptop (802.11g) to the router (802.11g) to a 10/100 switch to the slow box, and the same path to the fast box. They're both on the same switch.

 

I think I didn't pay attention to the original post, don't mind me please.

----------

## mauricev

 *Quote:*   

> Getting files from this box is speedy, but it is hell trying to send stuff to it. 

 

This sounds like a mismatched duplex setting. Does the switch tell you whether the connection is half or full duplex? What's the NIC setting? Trying forcing everything manually to full-duplex.

----------

## trossachs

How would you force to manual duplex?

----------

## mauricev

emerge ethtool

ethtool eth0, for example, will tell you what the eth0 card is set to. It has options to force speed and duplex.

----------

## jeezus84

i know this is an old post but i just realized that my slow gentoo box is still runnign kernel-2.6.9-r1. could that have something to do with it?

----------

## jeezus84

i tried emerging ethtool (version 2) but i don't get anything:

```

underMyDesk modules.d # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:10:A7:29:80:57

          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::210:a7ff:fe29:8057/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:74410 errors:5064 dropped:0 overruns:0 frame:5096

          TX packets:79756 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:57790996 (55.1 Mb)  TX bytes:19220806 (18.3 Mb)

          Interrupt:22 Base address:0xac00

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:62 errors:0 dropped:0 overruns:0 frame:0

          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:4916 (4.8 Kb)  TX bytes:4916 (4.8 Kb)

underMyDesk modules.d # ethtool eth0

Settings for eth0:

No data available

underMyDesk modules.d #

```

Here are the modules I have loaded:

```

underMyDesk modules.d # lsmod

Module                  Size  Used by

nfsd                  226048  9

lockd                  68648  2 nfsd

sunrpc                149572  12 nfsd,lockd

ipv6                  268864  19

tulip                  56096  0

bttv                  161168  0

video_buf              23556  1 bttv

firmware_class         11776  1 bttv

i2c_algo_bit           11016  1 bttv

v4l2_common             6912  1 bttv

btcx_risc               6024  1 bttv

tveeprom               14360  1 bttv

videodev               11136  1 bttv

i2c_i801                9868  0

i2c_core               24064  4 bttv,i2c_algo_bit,tveeprom,i2c_i801

intel_agp              24604  1

agpgart                38096  1 intel_agp

rtc                    10772  0

cifs                  206452  0

dm_mod                 62500  0

ata_piix               10884  0

ahci                   12804  0

sata_qstor             11012  0

sata_vsc                9220  0

sata_uli                8448  0

sata_sis                8320  0

sata_sx4               15364  0

sata_nv                10628  0

sata_via                9860  0

sata_svw                8708  0

sata_sil               10372  0

sata_promise           12420  0

libata                 50564  12 ata_piix,ahci,sata_qstor,sata_vsc,sata_uli,sata_sis,sata_sx4,sata_nv,sata_via,sata_svw,sata_sil,sata_promise

sbp2                   25736  0

ohci1394               37300  0

ieee1394              107608  2 sbp2,ohci1394

sl811_hcd              14976  0

ohci_hcd               23172  0

uhci_hcd               35088  0

usb_storage            77376  0

usbhid                 47200  0

ehci_hcd               34696  0

usbcore               125404  7 sl811_hcd,ohci_hcd,uhci_hcd,usb_storage,usbhid,ehci_hcd

underMyDesk modules.d #

```

I also updated to the newest kernel I could find:

```

underMyDesk modules.d # ls /boot

System.map-2.6.9-gentoo-r1

System.map-genkernel-x86-2.6.12-gentoo-r6

boot

grub

initramfs-genkernel-x86-2.6.12-gentoo-r6

initrd-2.6.9-gentoo-r1

kernel-2.6.9-gentoo-r1

kernel-genkernel-x86-2.6.12-gentoo-r6

lost+found

underMyDesk modules.d #

```

So, i'm stumped. What should one do?

----------

## mauricev

There is another ethernet card tool called mii-diag. You might try that.

----------

## jeezus84

```

underMyDesk modules.d # mii-diag eth0

Basic registers of MII PHY #1:  1000 786d 001d 2411 05e1 45e1 0007 2001.

 The autonegotiated capability is 01e0.

The autonegotiated media type is 100baseTx-FD.

 Basic mode control register 0x1000: Auto-negotiation enabled.

 You have link beat, and everything is working OK.

 Your link partner advertised 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control.

   End of basic transceiver information.

underMyDesk modules.d #

```

I still don't know what's up. Uploads are slow as hell, and downloads are nice and speedy.

----------

## mauricev

What's the Ethernet status of the other computer? Is there a hub in between? What if you connect with a crossover cable?

----------

## jeezus84

the other computer runs Windows XP SP2 and everything seems to be hunky dory.

```

Microsoft Windows XP [Version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Ian>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : themotherland

        Primary Dns Suffix  . . . . . . . :

        Node Type . . . . . . . . . . . . : Unknown

        IP Routing Enabled. . . . . . . . : No

        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Wireless Network Connection:

        Connection-specific DNS Suffix  . :

        Description . . . . . . . . . . . : Intel(R) PRO/Wireless 2200BG Network

 Connection

        Physical Address. . . . . . . . . : 00-0E-35-8B-8A-BF

        Dhcp Enabled. . . . . . . . . . . : Yes

        Autoconfiguration Enabled . . . . : Yes

        IP Address. . . . . . . . . . . . : 192.168.1.102

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 192.168.1.1

        DHCP Server . . . . . . . . . . . : 192.168.1.1

        DNS Servers . . . . . . . . . . . : 209.105.192.122

                                            206.108.253.70

        Lease Obtained. . . . . . . . . . : Wednesday, August 10, 2005 11:15:52

PM

        Lease Expires . . . . . . . . . . : Wednesday, August 10, 2005 11:25:52

PM

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . :

        Description . . . . . . . . . . . : Broadcom 440x 10/100 Integrated Cont

roller

        Physical Address. . . . . . . . . : 00-C0-9F-58-8A-F1

        Dhcp Enabled. . . . . . . . . . . : Yes

        Autoconfiguration Enabled . . . . : Yes

        IP Address. . . . . . . . . . . . : 192.168.1.101

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 192.168.1.1

        DHCP Server . . . . . . . . . . . : 192.168.1.1

        DNS Servers . . . . . . . . . . . : 209.105.192.122

                                            206.108.253.70

        Lease Obtained. . . . . . . . . . : Wednesday, August 10, 2005 11:15:54

PM

        Lease Expires . . . . . . . . . . : Wednesday, August 10, 2005 11:25:54

PM

C:\Documents and Settings\Ian>

```

----------

## deflin39

jeezus84 - 

I had this exact same problem a few years back (except at the time it was a Red Hat box).  I spent way too much time and money replacing net cards and wires before finding out it was just a bad port on my hub (the port the XP box was connected to).

Dunno if this is your problem too but its worth a look at.

Good luck!

deflin39

----------

## mauricev

 *Quote:*   

> the other computer runs Windows XP SP2 and everything seems to be hunky dory. 
> 
> 

 

It is? What's the duplex and speed of the card? Have you tried manually setting it to 100/full duplex?

----------

## marquischan

I am facing the same problem now also... ...

only got 50KB/s ... ... is it related to my server's LAN Card?

----------

## mauricev

Almost certainly one of the cards is at the wrong duplex setting.

----------

## marquischan

ns1 ~ # mii-diag eth0

Basic registers of MII PHY #1:  1000 786d 001d 2411 05e1 45e1 0007 2001.

 The autonegotiated capability is 01e0.

The autonegotiated media type is 100baseTx-FD.

 Basic mode control register 0x1000: Auto-negotiation enabled.

 You have link beat, and everything is working OK.

 Your link partner advertised 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control.

   End of basic transceiver information.

is there any problem? THANKS

----------

## mauricev

 *marquischan wrote:*   

> ns1 ~ # mii-diag eth0
> 
> The autonegotiated media type is 100baseTx-FD.
> 
> s there any problem? THANKS

 

I would confirm with ethtool, but I think it says the connection speed is correct, 100 BaseT with full duplex.

You might want to to run some tests with a utility like netperf and see what performance you get. That would tell if you if the tcp stack is working correctly.

----------

## marquischan

Tested FTP , i got 90% Performance

but when using Samba ... only got 5% Performance

... ...

----------

## lizardqueen

I'm having this problem too - spent the last few weeks trying to solve it.

I have gigabit cards on both the gentoo box and the windows box. 

For reads from a samba share (Raid 0) I get about 150Mbit (which is not fantastic, but I can live with it), but writes to samba top out at about 1.5Mbit. The write speed is getting really annoying.

Ethtool tells me the link is gigabit, full duplex, as does the switch that I am going into, so I'm fairly certain it isn't a problem with the card.

My samba settings are basically the same as above.

Anyone got any suggestions other than having to dig into packet analysis...

LQ

----------

## gemmell

I am also having the same problem:

I have two boxes, on one the samba runs sweet, on the other it's deathly slow.

The difference is that one is on a wireless network whilst the otherone is plugged through the hub. If I scp between one and the other I only get 400Kbps, so I guess this is a hardware related thing. 

mii-diag says it's a 100Mbit link with full duplex.

How. Annoying.

I'll try connecting a laptop through the hub (so its ethernet to ethernet) and see if that does better than wireless to ethernet

----------

## gemmell

Hrrm, seems when I'm connected to the hub it's slow too. I guess I could try connecting direct....

I noticed that if I do a smbmount from my computer then it's blazingly fast! It's just that browsing it is slow.

----------

