# *Very* strange problem with samba performance

## Forse

Hi everyone. I finally decided to give xfs a go so I changed gentoo-sources to xfs-sources. I have changed CFLAGS in kernel Makefile to:

```
-Wall -Wstrict-prototypes -O3 -fomit-frame-pointer -march=pentium3
```

 So I booted to it and *BAM* samba started to lag...by lag I mean that watching DivX jums and freezes. I am on 100mb LAN and that worked perfectly before. I have this in smb.conf:

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

 While trying to watch DivX my server cpu is about 2%...I have changed nothing anywhere....Just booted to XFS-Sources. 

P.S. I forgot to mention that I have no LAN activity at the moment of testing  :Evil or Very Mad:  The DivX:es that I try to play are NOT on XFS...they're on reiser

 It's such a pitty if I have to change back to gentoo-sources...coz I really like xfs performance with my DivX files   :Razz: 

Thnx in advance

----------

## Forse

anyone any ideas?

----------

## Forse

i am going insane...I am recompiling samba...I dount that it will help....dammit   :Evil or Very Mad: 

----------

## handsomepete

 *Forse wrote:*   

> Hi everyone. I finally decided to give xfs a go so I changed gentoo-sources to xfs-sources. I have changed CFLAGS in kernel Makefile to:
> 
> ```
> -Wall -Wstrict-prototypes -O3 -fomit-frame-pointer -march=pentium3
> ```
> ...

 

While I'm a bit confused, I'll ask this - if you boot back to your old kernel, do the DivX files play normally again?  What does samba have to do with your DivX performance?  Are the DivX files on the local PC?  Did you include all of the necessary file system support (including reiserfs, xfs, etc.) in your XFS kernel?

----------

## Forse

 *handsomepete wrote:*   

> 
> 
> While I'm a bit confused, I'll ask this - if you boot back to your old kernel, do the DivX files play normally again?  What does samba have to do with your DivX performance?  Are the DivX files on the local PC?  Did you include all of the necessary file system support (including reiserfs, xfs, etc.) in your XFS kernel?

 

Let me explain a bit more...There are two PC:s: linux and windows. Linux provides Divx files via samba for Windows. They are on 100mb lan. Booting to old kernel is impossible right now, coz it's server and users use it. I have all needed FS supports in kernel buildin, such as reiser, XFS and ext2/3. The only thing I have done is booted to XFS kernel, nothing else. I didn't change anything in system   :Confused: 

P.S. I configured my xfs kernel same as my old one...except for XFS support

----------

## Forse

NOW i AM REALLY PISSED OFF....DAMMIT...I just booted to my old kernel and everything is fine.......dammit   :Twisted Evil: 

----------

## handsomepete

 *Forse wrote:*   

> NOW i AM REALLY PISSED OFF....DAMMIT...I just booted to my old kernel and everything is fine.......dammit  

 

Well, you could try this:

Copy your current .config (from gentoo-sources or whatever) to the xfs-sources and 'make oldconfig'.  Do not remove anything from the configuration, *only* add xfs file support.  make dep && make blah blah blah and try that kernel.  If the same problem exists, then you can assume that it's something in the xfs-sources that slows things down (or something in your original sources that does things right).  From there you can consider alternatives - you can always try a dev kernel - I think some of those (all?) have xfs support.

----------

## Forse

 *handsomepete wrote:*   

>  *Forse wrote:*   NOW i AM REALLY PISSED OFF....DAMMIT...I just booted to my old kernel and everything is fine.......dammit   
> 
> Well, you could try this:
> 
> Copy your current .config (from gentoo-sources or whatever) to the xfs-sources and 'make oldconfig'.  Do not remove anything from the configuration, *only* add xfs file support.  make dep && make blah blah blah and try that kernel.  If the same problem exists, then you can assume that it's something in the xfs-sources that slows things down (or something in your original sources that does things right).  From there you can consider alternatives - you can always try a dev kernel - I think some of those (all?) have xfs support.

 

Thnx a lot for advice...but it...didn't help...dammit...prkl...Well I'm going to abandon XFS...and go back to ext3...

----------

## Forse

Now I get something...I've been using linux-2.4.19-gentoo-r10 and samba works fine...divx plays with no problem...but whenever I try ANY 2.4.20 series kernel I get lag performance in samba...It's not XFS-Sources problem..coz linux-2.4.20-gentoo-r5 doesn't work either   :Evil or Very Mad:   Any ideas?

Here is my info:

```
00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)

00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)

00:07.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)

00:07.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)

00:07.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01)

00:07.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)

00:09.0 Unknown mass storage controller: Promise Technology, Inc. 20269 (rev 02)

00:0a.0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U (rev 01)

00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

00:0c.0 Ethernet controller: VIA Technologies, Inc. VT86C100A [Rhine] (rev 06)

01:00.0 VGA compatible controller: 3Dfx Interactive, Inc. Voodoo 3 (rev 01)
```

```
processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 7

model name      : Pentium III (Katmai)

stepping        : 3

cpu MHz         : 499.951

cache size      : 512 KB

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 2

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse

bogomips        : 996.14
```

----------

## ARC2300

Couple of ideas.

If you're running a server, why don't you try the wolk-sources?  They have XFS support in them.

Also, try re-emerging Samba under the new kernel.  Since the compiles quite possibly use the kernel headers, and each kernel is slightly different (dunno about the headers) that may be a possible solution also.

I use wolk-sources on my K6-III 600MHz for MP3 and file sharing, and I had 3 computers all listening to high bitrate MP3's and I had one computer copy a 27MB file over the network.  None of the MP3's skipped once, and the file transfer was maybe slightly slower than without MP3's playing.

I whole-heartedly suggest trying the wolk-sources.   :Smile:   They're quick, and they have server/desktop tweaks built in, depending on which platform you're using them on.   :Smile: 

----------

## Forse

 *ARC2300 wrote:*   

> Couple of ideas.
> 
> If you're running a server, why don't you try the wolk-sources?  They have XFS support in them.
> 
> Also, try re-emerging Samba under the new kernel.  Since the compiles quite possibly use the kernel headers, and each kernel is slightly different (dunno about the headers) that may be a possible solution also.
> ...

 

What fs are you using? Sounds tempting...

----------

## Forse

Why is it masked?

```
*  sys-kernel/wolk-sources [ Masked ]

      Latest version available: 4.0

      Latest version installed: [ Not Installed ]

      Size of downloaded files: 35,554 kB

      Homepage:    http://wolk.sourceforge.net http://www.kernel.org

      Description: Working Overloaded Linux Kernel
```

 *From SourceForge wrote:*   

> Release Name: WOLK-4.1
> 
> Notes:
> 
> WOLK 4 got a split into 2 parts. There is a Server-Edition and there will be a
> ...

 

So how can I emerge the server version?

----------

## ARC2300

Right now on my server I'm using reiserFS, but when I get a new job and some more cash, I'm going to be putting a much larger HDD in and possibly use XFS (as my g/f wants to try her hand at video capture and editing, XFS is best with large files).

And the really cool thing is that the drive I'm running all this off of is a U8 series Seagate, ATA/66 with only a 512KB cache.   :Shocked:   I really wasn't expecting half of the performance I'm getting out of it.  I've never had MP3's or any file transfers stall at all like I did on Windows.   :Shocked: 

Right now, actually, I'm transfering about 3-4 GB of DivX files to the server and listening to MP3's just fine.  I feel that's a feat in and of itself with a server only having 128MB of RAM and a slow HDD.   :Very Happy: 

----------

## ARC2300

 *Forse wrote:*   

> Why is it masked?
> 
> ```
> *  sys-kernel/wolk-sources [ Masked ]
> 
> ...

 

Uh, no clue.   :Confused:   That's a question better directed at the Gentoo folks.

Although, if you want to emerge it, you can do a couple of things.

Change your 'ACCEPT_KEYWORDS="~x86"' in your '/etc/make.conf' file, then comment it out once the sources are emerged.

Or you can just type "emerge /usr/portage/sys-kernel/wolk-sources/wolk-sources-4.0_rc8.ebuild merge"

That may do the trick.

----------

## Forse

Ok I got wolk-sources up and running....and after booting to it I did remerge samba...but no dice....dammit...I am so pissed off  :Evil or Very Mad:  ...I am...ok...ok...I need to come down...Any...and I repeat any...advice is welcomed   :Cool: 

----------

## Forse

I have remerged samba with this flags:

```
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
```

But still no dice...fsck

----------

## ARC2300

Couple of things that may help.

A)  Post your kernel .config, which can be found in '/usr/src/linux'

B)  Post your smb.conf file

Other than that, I'm out of ideas.   :Confused: 

BTW, these are the wolk 4.0 sources. . .by reading that note from SourceForge, seems they only got split for the 4.1 version.

And for you CFLAGS, since you have a PIII, put '-mmmx -msse -mfpmath=sse'.  Since your processor supports SSE, you may notice a little but of a boost in some things.

----------

## Forse

DAmm....here are configs you've asked:

http://www.goldenrain.net/Temp/config.txt

http://www.goldenrain.net/Temp/smb.conf

thnx for help

----------

## ARC2300

Couple of things you can do to speed things up. . .

Does your server have a Windows HDD in it??  If no, get rid of all the other filesystems other than the ones you need (ext2 & 3, reiserFS, XFS, Proc, devFS (take out DEVPTS_FS support), RAMFS, TMPFS).  That will save you some space simply by not having used modules in there that aren't needed.

Compile in NFS support and SMB support.  Not as modules, but compile them in that way the kernel doesn't load/unload the module all the time (as I understand, if a module isn't used for an amount of time or the kernel needs the RAM, it will unload a module).  Uncheck all the other filesystem under network FS.

Under NLS, depending on where you live, you'll have to code something in there for SMB support.

Definetly disable everything under kernel hacking, as that slows things down because the kernel tries to make itself crash if a discrepancy occurs (from how I understand it).

Other than that, I didn't really see much else wrong.

But I will say, that if you don't need it, don't compile it in at all.  If you use it once in a while, compile it in as a module.  If you think you might use it more than, say, once a day, compile it into the kernel.

----------

## Forse

 *ARC2300 wrote:*   

> Couple of things you can do to speed things up. . .
> 
> Does your server have a Windows HDD in it??  If no, get rid of all the other filesystems other than the ones you need (ext2 & 3, reiserFS, XFS, Proc, devFS (take out DEVPTS_FS support), RAMFS, TMPFS).  That will save you some space simply by not having used modules in there that aren't needed.
> 
> Compile in NFS support and SMB support.  Not as modules, but compile them in that way the kernel doesn't load/unload the module all the time (as I understand, if a module isn't used for an amount of time or the kernel needs the RAM, it will unload a module).  Uncheck all the other filesystem under network FS.
> ...

 

I did everything but no dice...I am running out of ideas....dammit... but thnx a lot for trying   :Crying or Very sad: 

----------

## ARC2300

Hey. . .this ain't M$. . .we don't charge for tech support help.   :Razz:   We're all here to better ourselves and anyone else willing to try.  Or at least I am.   :Smile: 

I haven't checked through your smb.conf, but I'll check that out in a bit.  I had to go home today to change my spark plug wires on my '92 Cutlass.

----------

## Forse

I noticed this in my logs:

```
NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.
```

Any ideas?

----------

## ARC2300

In my kernel, under Character Devices/Watchdog cards, I have /dev/nvram Support checked and Enhanced Real Time Clock Support checked also.

And another I meant to ask. . .what NIC do you have??  I totally forgot looking through your kernel config until you posted that, but you have about 4 different NIC drivers included.   :Confused:   That may be causing a problem if the wrong one gets loaded. 

http://www.cruea.net/config

Check that over. . .that's the .config for my server running wolk rc7's (need to emerge the rc8's, though).

And that .config isn't what I use right now. . .the only difference being in the one listed about I put the gresecurity in it, and i haven't tested it yet.  When my server absolutely MUST go down, then I'll recompile my kernel and give that a shot.

----------

## Forse

 *ARC2300 wrote:*   

> In my kernel, under Character Devices/Watchdog cards, I have /dev/nvram Support checked and Enhanced Real Time Clock Support checked also.
> 
> And another I meant to ask. . .what NIC do you have??  I totally forgot looking through your kernel config until you posted that, but you have about 4 different NIC drivers included.    That may be causing a problem if the wrong one gets loaded. 
> 
> http://www.cruea.net/config
> ...

 

I have 2 NIC's and here they are:

```
00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

        Subsystem: Realtek Semiconductor Co., Ltd. RT8139

        Flags: bus master, medium devsel, latency 64, IRQ 5

        I/O ports at bc00 [size=256]

        Memory at ed004000 (32-bit, non-prefetchable) [size=256]

        Capabilities: [50] Power Management version 2

00:0c.0 Ethernet controller: VIA Technologies, Inc. VT86C100A [Rhine] (rev 06)

        Subsystem: D-Link System Inc DFE-530TX rev A

        Flags: bus master, medium devsel, latency 64, IRQ 11

        I/O ports at c000 [size=128]

        Memory at ed005000 (32-bit, non-prefetchable) [size=128]

        Expansion ROM at ec000000 [disabled] [size=64K]
```

I enabled the same drivers in wolk-sources that I did in gentoo-sources(2.4.19)

----------

## ARC2300

Really stupid, but what did the 2.4.19 sources say were the card's drivers??

The reason I ask is that a few times I've switched versions (the most memorable was 2.2.16 to 2.4.20), and the kernel detected things, but some things were detected wrong, or the wrong driver simply got assigned.  You might try making the NIC drivers modules, then load them manually with insmod, and see what that does.

For example, your card with the RealTek may use the 8139 PCI instead of the 8139C driver, which could still work, but make the card act haywire.  I use a D-Link DFE-530TX+, and it uses the PCI drivers, not the C+ drivers.

And just out of curiousity, do both NICs use Samba, or is it just one???  If it's both, unhook one, see what flies.  If it's only one, try hooking the other up, see if it works.  If one NIC does, the other doesn't, then that could quite possibly be a defunct driver.   :Very Happy: 

----------

## Forse

ok...something must be wrong with eth0, coz I get all *the time this error*:

```
NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.

NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.
```

I am now compiling drivers for NIC's in modules  :Smile: 

----------

## Forse

Now I finally know where is the problem. My netwotk card "VIA Technologies, Inc. VT86C100A [Rhine] (rev 06)" doesn't work correctly. I recompiled kernel with this options:

```
<M>     VIA Rhine support

[*]       Use MMIO instead of PIO (EXPERIMENTAL)
```

I also tried without "[*]       Use MMIO instead of PIO (EXPERIMENTAL)"...Funny thing is that card works but I get:

```
NETDEV WATCHDOG: eth0: transmit timed out

eth0: Transmit timed out, status 0000, PHY status 782d, resetting...

eth0: Setting full-duplex based on MII #8 link partner capability of 41e1.
```

And card performance is soooo....poor...Only 200kb/s and it's 10/100 card, that's why my samba is sooo slow  :Smile: 

Any ideas? plz I am going mad....and I mean mad   :Crying or Very sad:   Thnx in advance 

BTW here is lsmod:

```
Module                  Size  Used by    Not tainted

via-rhine              13680   1

8139too                14952   1

mii                     2560   0  [via-rhine 8139too]

i2c-piix4               4204   0  (unused)

dmi_scan                1572   0  [i2c-piix4]

ipt_state                536  17  (autoclean)

ipt_LOG                 3352   1  (autoclean)

iptable_filter          1708   1  (autoclean)

iptable_nat            17272   1

eeprom                  3636   0  (unused)

w83781d                20464   0  (unused)

i2c-isa                 1128   0  (unused)

i2c-proc                6992   0  [eeprom w83781d]

i2c-core               16072   0  [i2c-piix4 eeprom w83781d i2c-isa i2c-proc]

usbcore                61760   1
```

----------

## ARC2300

Okay, so now we have it down to a driver problem.  WOOHOO!!

Uh, what motherboard do you have??  There might have been a change in the VIA driver between 2.4.19 and 2.4.20.  

Have you checked to see if it is a VIA NIC, or maybe someone else made the chip??  I've never worked with onboard NIC cards, so I could be wrong.

And I don't know, but what is the mii module???  That seems to be thoroughly pissed off.

----------

## Forse

 *ARC2300 wrote:*   

> Okay, so now we have it down to a driver problem.  WOOHOO!!
> 
> Uh, what motherboard do you have??  There might have been a change in the VIA driver between 2.4.19 and 2.4.20.  
> 
> Have you checked to see if it is a VIA NIC, or maybe someone else made the chip??  I've never worked with onboard NIC cards, so I could be wrong.
> ...

 

I got enough of this....I went to store and got new NIC realtek based. Now everything is fine  :Smile:    Thnx a lot for help ARC2300   :Razz: 

----------

## Reformist

This is unacceptable. There is a wisespread issue with with the VIA Rhine drivers in the kernel. I have 3 VIA Rhine cards myself, they are often included as the onboard cards for laptops and desktops. It's not practical to ignore that chipset and move on to another one... it's everywhere.

I get 5MB transfer speeds to a machine with a rhine card, and about 5000 B/s (5K) a second from it... this is with samba and ssh (scp).

I haven't found a solution yet.

----------

## JjcampNR

Well, the first thing I would do is search bugs.gentoo.org and if nothing matches your problem, file a new bug report.  The only way things are going to get fixed is if people report problems so that developers and others know about them.

Josh

----------

