# Samba on new hardware EXTREMELY slow unless ....

## Klainn

I've setup a new linux box running gentoo and for some reason the transferring of files between windows and the linux box is painfully slow.

The new hardware is an MSI PM8M2-V board with an intel celeron chip and a gig of ram, the rest of the hardware was taken out of the old box (harddrives, gigabit nics, video) and they are all working well.

On the old machine running gentoo (all machines have gigabit nic routed through a single gigabit switch) the transfer rates were has you expect. A movie around 2-3 minutes, an mp3 without even knowing it was transferred, etc. With gentoo on the new board and chip, if I transfer 1 file at a time, it's painfully slow. An mp3 will take 4 minutes. A movie up to 50-60 minutes. If I transfer 2 or 3 files at the same time the transfer is a little faster, but not where it needs to be.

Anyone have any idea what might be different on this box then the last? I've tried recreating the smb.conf file and using the one from the old machine, but nothing works. I've checked these forums and there were similar issues, but nothing quite like this.  I hope someone might have a fix that I just didn't find.

Thanks for reading.

----------

## rcb1974

 *Klainn wrote:*   

> I've setup a new linux box running gentoo and for some reason the transferring of files between windows and the linux box is painfully slow.
> 
> On the old machine running gentoo (all machines have gigabit nic routed through a single gigabit switch) the transfer rates were has you expect. A movie around 2-3 minutes, an mp3 without even knowing it was transferred, etc. With gentoo on the new board and chip, if I transfer 1 file at a time, it's painfully slow. An mp3 will take 4 minutes. A movie up to 50-60 minutes. If I transfer 2 or 3 files at the same time the transfer is a little faster, but not where it needs to be.
> 
> Anyone have any idea what might be different on this box then the last? I've tried recreating the smb.conf file and using the one from the old machine, but nothing works. I've checked these forums and there were similar issues, but nothing quite like this.  I hope someone might have a fix that I just didn't find.

 

I'm experiencing the same problem.  FTP transfers on my home LAN are what I'd expect -- very fast.  SMB transfers are very slow for some strange reason.  smb.conf looks good.  What is going on?

----------

## Klainn

I'd posted this question on the Gentoo (here) and the debian forums but the only responses came from Debian. A couple users there told me it HAD to be that my drives weren't using DMA, but that's just not the case. I'm 100% positive it was something about the configuration on the board / network card that caused my problems. I installed gentoo on the harddrive in the machine with the slow transfers and then took it out and plugged it back into the old machine and the transfers were as expected. For me it's not a configuration on the drives and it's not configuration of gentoo / samba. I never actually got an answer to my question, but I do believe it was related to the MSI board / Celeron chip / or NIC (however I don't believe nic because I use the same gigabit nic in ALL boxes).

----------

## Aurisor

Do you get normal transfer speeds between the two machines via different protocols, such as ftp?  Do you have any weird firewall shit going on?

----------

## Janne Pikkarainen

Common checklist:

- Network settings (is NIC in full duplex mode? Does ifconfig report collisions or errors? Maybe MTU size is wrong?)

- IDE HD settings - is DMA turned on?

- Nearly full file system (with ReiserFS anything above 90-95% is bad) can lead to VERY poor performance with Samba.

- See network traffic with wireshark and try to spot oddities.

----------

## freemanix

I had the same problem - ASUS P5B motheboard with Realtek 8169 1-GBit card. Everything looked fine, was fast (FTP, ssh, rsync, ..) until I switched to SAMBA. The reading from server was at about 100-200 kB/sec, writing was at full speed of our 100Mbit network - above 9MB/sec. I tried both 2.6.18 and 2.6.19 kernels with no success. 

Finally, I put old-but-proven Realtek 8139 PCI 100Mbit card inside and voila ... speed is 9MB/sec in both directions, without problems. 

Has somebody similar problems with Realtek 8169? What is the cause? Some special approach to network card from SAMBA?

----------

## OrangeToque

I'm experiencing similar woes, Samba over a gigabit connection with a Windows XP box is painfully slow.  FTP 50 MB/s , samba almost unusable!  And my old 10/100 baseT card preforms better over the gigabit card (with samba)!

Any ideas?

----------

## pops45042

I've also got the same problem. I've been reading over various forum posts about slow transfers with samba over a network that has all the gigabit capable hardware. The common problem in all the cases that I have read is the realtek gigabit card.

I've tried a bunch of different settings and have read over other posts where people have also tried many of the same things. It seems that for those of us out there running a realtek 8169 gigabit card, transferring files via samba is painfully slow. By slow, I mean a max of 1.5MB/sec over a gigabit line capable of doing 125MB/sec. Granted, the hardware has to be able to sustain the read/write rate. But on the same hardware under winXP, I see transfers in both directions of 20-25MB/sec. In linux with samba the connection sucks.

I have also tried both the kernel 2.6.19-gentoo-sources provided driver and the realtek 1.05 driver. Both show the same performance problem.

Has anyone gotten a realtek 8169 gigabit card to work with samba at gigabit speeds? Please post.

Thanks,

Paul

----------

## deface

A few things i can recommend doing are:

1. If you do not have a WINS server, you may enable it on the samba server. (recommended) Then disable master browser service on your windows clients via the services mmc (start > run > services.msc)

wins support = true

If you do have a wins server, set it by doing 

wins server = 10.0.0.200

&

os level = 20

Adding the OS Level in smb.conf will stop Samba from acting as the master browser. By default, Windows machines are set to be the master browser service, this causes a conflict between the devices with battling over who to announce to, as well as un-needed network traffic.

2. If you are not using any ipv6 - disable all options in your kernel.

3. Disable CUPS printing in smb.conf if your not using it.

Here is a simple, but working smb.conf file of mine

[22:57][root@firewall][conf.d]$ cat /etc/samba/smb.conf

#======================= Global Settings =====================================

[global]

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

        load printers = no

        name resolve order = wins lmhosts bcast

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        interfaces = 10.0.0.0/24

        map to guest = bad user

        encrypt passwords = yes

        hosts allow = 10.0.0.

        printer admin = @adm

        dns proxy = no 

        netbios name = Firewall

        workgroup = SOLUTIONS

        wins support = true

        printcap name = cups

        preferred master = no

        max log size = 50

#============================ Share Definitions ==============================

[homes]

   comment = Home Directories

   browseable = no

   writable = yes

[www]

 comment = Website

 path = /var/www/localhost/

 valid users = root deface

 public = no

 writable = yes

[Apache]

 comment = Apache

 path = /etc/apache2

 public = no

 writable = yes

[DropBox]

 comment = DropBox

 path = /home/dropbox

 public = yes

 writable = yes

[Firewall Scripts]

 comment = Firewall Scripts

 path = /scripts

 public = yes

 writable = yes

 valid users = root

----------

## pops45042

My system setup

PC A

WD 120gig, nvidia gigabit ethernet card cat5e cable

connects via a netgear 8-port gigabit switch

PC B

cat5e cable, realtek r8169 gigabit card

raid 0 array on reiserfs 3 (samsung 400gig and samsung 500gig for 900gigs of goodness)

call this storage array NAS

This is what I'm stumped at. 

From PC A:

mount the NAS using samba

1) pulling a 900MB file from the NAS to the 120gig yeilds ~ 15MB/sec

2) pushing a 900MB file from the 120gig to the NAS yeilds ~ 500KB/sec *ouch*

mount the NAS using nfs v3

1) pulling a 900MB file from the NAS to the 120gig yeilds ~ 25MB/sec

2) pushing a 900MB file from the 120gig to the NAS yeilds ~ 22-48MB/sec

pull/push the file using fish:

1) pulling a 900MB file from the NAS to the 120gig yeilds ~ 20MB/sec

2) pushing a 900MB file from the 120gig to the NAS yeilds ~ 8MB/sec

So using nfs, the transfers appear to be more hdd limited, as it should be. However samba performance is horrible! I've played around with the smb.conf file for a bit and nothing i have done has effected its performance. Even fish is being a bit slow...

Any ideas?

Paul

```
[global]

   server string = Samba 3.0.22

   preferred master = Yes

   wins support = Yes

   ldap ssl = no

   interfaces = eth1

# I've tried socket options, no socket options...no effect!

   socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   load printers = no

[ftp]

   comment = tons of shizzz

   path = /mnt/store/ftp

   write list = <users and stuff>

   read only = No

   create mode = 0766
```

----------

## pops45042

I have to wonder. How hot can a gigabit network card run? I mean, I got to thinking about it and felt how how the card was getting. The chip gets hot enough that you can't keep your finger on it for longer than about 3 sec. This thing is running hot. I wonder if that could be part of the problem?

Paul

----------

## deface

CIFS!

----------

## pops45042

CIFS and SMB have the same performance -> horrible.

I've been reading review on this card and it appears that cards based on the 8169 chipset just stink under linux. I might have to break down and get a quality intel gigabit NIC.

Paul

----------

## dspgen

Do you have the same problem when running the card at 100mb?

I had similar troubles and I found when I switched to a 100mb switch it performed as it should.

I switched all my cables to cat 6, and gigabit works fine now - but I also tried many different things, so I don't know for sure that cat6 fixed it.

----------

## dstutz97

 *pops45042 wrote:*   

> cat5e cable, realtek r8169 gigabit card

 

and

 *freemanix wrote:*   

> Has somebody similar problems with Realtek 8169?

 

I had the same crappy performance with a realtek 8169 card.  FTP was 25-30Mb/sec as you would expect but samba was excruciatingly slow.  I purchased an Intel Gigabit adapter and everything is fine now.

----------

## pops45042

I've got an Intel gigabit card on the way. I'll post back with my results. Realtek based gigabit cards + Linux just plain suck with Samba.

Paul

----------

