# Slow network even with 100Mbps FD ?

## hiroki

Hi!

I am recently having a problem using my network connection, which consists of two Realtek 8139too cards connected via a Netgear router.

The problem is especially, that I don't know why it recently is so slow (about 1 MB/s) but has been about 10 times faster some weeks ago (let's say 4 weeks).

Both cards are running on 100 Mbit/s FullDuplex.

I already thought, that maybe by installing a new kernel version I forgot to set something essential in the config. Well, that's why I tested the different performances seperately, in order to detect the real problem. 

Because I always had about 10 MB/s while copying a file with scp and now only have 1 MB/s I tried network speed and disk speeds seperately:

netio told me, that the throughput between this and the other machine is a little more than 10 MB/s (using TCP). So this cannot be the problem.

Then I tried hdparm -t:

on this machine I get about 25 MB/s, on the other one I get 55 MB/s

So, that cannot be the problem :/

So what now? Where can there be another reason for the low speed?

Thanks in advance!

hiroki

PS: I am using kernel development-sources 2.6.5rc2 now, but before I was usng 2.6.3 and I had the same problem... Same kernel on both computers.

----------

## adaptr

A router - with switch ports, surely ?

What happens when you plug in a cross-cable ?

----------

## hiroki

Hi!

Yes, the router certainly has switched ports. Anyway, the router should not be the problem, because iperf & netio tell me, that my network has a datarate of 10MB/s so nearly the full theoretical bandwidth. This should not be the routers fault then. And I did not change anything about the router during the last few weeks, and just 3 or 4 weeks ago everthing worked well at full speed.... well, 10 MB/s. Now it's just 1MB/s. Very frustrating when transfering a lot of / large files.

thanks anyway.

but the problem is still there.

----------

## flybynite

try ifconfig and check for errors: dropped overrruns  frame etc...  Could give you a clue as to what kind of problem your having....

#ifconfig

(snip)

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

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

          collisions:0 txqueuelen:1000

----------

## hiroki

Hi!

I have been testing what you said, but there don't seem to be errors:

```
# LANG="en_US" ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 08:00:46:2E:F8:80

          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:46ff:fe2e:f880/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

          TX packets:1960181 errors:0 dropped:0 overruns:10 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1697253688 (1618.6 Mb)  TX bytes:924368964 (881.5 Mb)

          Interrupt:10 Base address:0x8800

```

What can it be then? It is really frustrating to have just 1 MB/s even though all components seem to have full datarate... I tried ftp, scp, nfs, all have 1 MB/s.

hiroki

----------

## Vaughn

It could be that you disabled (forgot to enable, rather) mmapped IO.

It's in networking options near the top somewhere.

----------

## hiroki

Hi!

Indeed, if forgot to switch mmaped IO on on my laptop's kernel. the tower's kernel has mmapped IO already enabled.

But this did not change anything about the network performance  :Sad: 

I really cannot understand what changed the average datarate using scp from more than 6 MB/s to about 1.5 to 1 MB/s

Often I even had 9 MB/s.

I also removed the router and plugged in my old switch that I have been using before, but the speed didn't change. 

What else could be the problem?

desperate hiroki

----------

## Epcylon

I have much the same problem. I can't seem to get any decent speed out of my network, although all the components are supposed to be ready for 100Mbit/s ...

The comps involved is a P3 650 with gentoo, and a Athlon XP2200+ with Windows XP. Both are using Realtek cards iirc...

Just thought I'd tack my reply on here and set notify when reply so I can try some of the solutions myself..  :Smile: 

----------

## flybynite

 *hiroki wrote:*   

> Hi!
> 
> I have been testing what you said, but there don't seem to be errors:
> 
> #ifconfig eth0
> ...

 

10 caught overruns!!!!  THATS your problem...  That should NEVER happen.. Check the other end of the network first..  Are you overclocking? Can you swap cable, network cards to troubleshoot?

----------

## hiroki

Hi!

Yes, I saw "overruns", but I could not imagine what it means.

So you think it's a hardware-problem?

That would mean that either the network cable or the NIC or even both are not working 100% correctly? Well, I don't have the possibility to change the NIC's. One side is a laptop, the other one a stationary computer, but I don't have another NIC for it. I can only exchange the cable. 

What do you mean by overclocking? If you mean the overclockng I know (CPU), then I don't do it. 

Thanks for you reply.

hiroki

----------

## flybynite

Overruns just shouldn't happen unless something is wrong.  This could mean hardware or most likely driver problems if that is the most recent change in your system.

Since you changed kernels recently, try an older kernel and driver.  Verify the driving your using.

```

# lsmod

```

will tell you which module.  If the driver is built in check the kernel config - here is a quick method if your sure that your using the last kernel you built. 

```

grep 8139 /usr/src/linux/.config

```

Which of these are set?

# CONFIG_8139CP is not set

# CONFIG_8139TOO is not set

# CONFIG_8139TOO_PIO is not set

# CONFIG_8139TOO_TUNE_TWISTER is not set

# CONFIG_8139TOO_8129 is not set

# CONFIG_8139_OLD_RX_RESET is not set

Do both ends of the link have overruns?

----------

## kashani

10 overruns with 2 million packets transferred is fine. Also you sometimes get overruns if you've rebooted the machine and it is plugged into the network. You'll get a few in the negotiation process and sometimes other wierd things. 

Not sure what you're problem is but it doesn't appear to be duplex, switch, cable related.

BTW are the two machines on the same network? I've sometimes seen people move the machines around so that now packets are forces to route instead of switch which would account for the speed decrease. 

These can switch

10.10.10.x/24

10.10.10.y/24

These will have to route

10.10.10.x/24

10.10.11.y/24

kashani

----------

## hiroki

hi!

thanks for your replies.

well, all the machines are in the same net: 192.168.1.0/255.255.255.0

But maybe I have a new "hint". While using ftp or ssh to copy from one to another computer i have a high percentage of waiting processes:

 *Quote:*   

> 
> 
> Cpu(s): 16.3% us,  7.7% sy,  0.0% ni,  5.8% id, 67.3% wa,  2.9% hi,  0.0% si
> 
> 

 

What could be the reason for that? Or is it also normal?

hiroki

----------

## hiroki

 :Very Happy: 

I have good news  :Smile: 

Now I again have high transfer rates in my network  :Smile: 

As I already said, I only had transfer rates of 1.5 MB/s and less (often less!).

Yesterday I decided to try the love-sources (2.6.5-love2), Today I compiled 2.6.5love3.

I did not think of my network speed at all  :Smile: 

BUT:

Now I again have noticeably more than 6 MB/s with scp. yesssaaa  :Smile: 

finally I hav my good ol' network back  :Smile: 

Anyway, thanks for all of your suggestions.

Well, it seems very strange, that love-sources gave me my usual network speed back. I don't understand why, I stll have the same hdparm-performance and still the same results with netio / iperf

The only thing I changed about my kernel config was to remove the iptables.

Maybe that caused the low speed?

I don't know.. Actually I just copied the config from the previous kernel and removes iptables...

Maybe that was it.. or love-sources has some kind of mysterious patch included, that solves my problem. At the moment I tend to think, that it was iptables' fault :/

Although (as I think) that _should_ not be...

many many greetings from germany  :Smile: 

hiroki

PS: I still have overruns  :Wink: 

----------

## kronon

once I used some kind of util that could change the network cards transmissions mode (10mbs ro 100mbs), all it did whas fuck up my network card. I went from 300 kbs to 10 kbs and less. In the end the programm couldn't correct my card any more and it stayed "broken". So I put an other card in it and that one worked with the origional 300kbs. I trew the old one away. This happen 2 times with 2 different type of network cards.

----------

## Peracles

 *kronon wrote:*   

> once I used some kind of util that could change the network cards transmissions mode (10mbs ro 100mbs), all it did whas fuck up my network card. I went from 300 kbs to 10 kbs and less. In the end the programm couldn't correct my card any more and it stayed "broken". So I put an other card in it and that one worked with the origional 300kbs. I trew the old one away. This happen 2 times with 2 different type of network cards.

 

It probably is a mismatch in capabilities of the network interfaces.  If u allow your NIC to autonegotiate its capabilities, you can sometimes have problems when the negotiated transfer rate is mistakenly set to a lower value which doesn't match the switch/router.  Do a man on ifconfig and look up media and mediaopt specifically.  You may also be able to explicitly set the switch/routers ports to 10/100 full/half duplex as well.

example (100Mbit full-duplex):

ifconfig eth0 media 100baseTx mediaopt full-duplex

Hope this helps.

EDIT:

You can check to see what it is being set to now by looking at your dmesg output.  It will show what your interfaces are coming up as.

----------

## hiroki

hi

thanks,  but i  am definately using 100 Mbps, and I am using auto-neg.

i am sure about that, because mii-tool / ethtool told me that.

so it should not be that kind of problem...

especially it cannotz be, because all transfers (f.i. with scp) start at about 5 MB/s, and then decrease down to 1 MB/s (sometimes even dow to 300 KB/s)

anyway, 100 FD has always been activated (as mentioned before and in the topic). That was also my first idea, that it could be the wrong mode...

thanks anyway.... maybe it was really iptables' fault... and if not.. changing to love-sources-2.6.5-love3 helped  :Smile: 

hiro - ki

----------

## crotty

check to make sure DMA is enabled on your hard disks

```
test root # hdparm -d /dev/hda

/dev/hda:

 using_dma    =  1 (on)

```

if that is off (as happened to me for a long while before i realized what was making large network transfers so slow), you have to turn it on

```
test root # hdparm -d1 /dev/hda

```

Also, if that gives you some sort of permission denied error, then do an lspci, and look at your IDE interface (I guess? that's what it was for me). Theeeeeen, recompile your kernel, and try to find the right option to enable under 

```
ATA/IDE/MFM/RLL Support -> IDE, ATA, and ATAPI Block Devices
```

near the bottom. Mine was VIA82CXXX. Compile that in, reboot with new kernel, and try turning DMA back on.

That was pretty long winded, but it helped me in the past.

Good luck!

----------

## hiroki

well, as I already wrote   :Rolling Eyes: 

I definately have DMA enabled! I also posted my hdparm -t results, which were about 20 MB

So that shoudl _not_ be the problem. 20 MB/s disk speed should be quite enough to handle a network transfer of about 10 MB/s. Especially when there is no other process using the disk.

Thanks anyway. I hope love-sources (which I have now) will continue working like they do now. 

hiro

----------

## momoarrowz

Heya, i had the same issue and just found out DMA was off on the target drive   :Embarassed: 

----------

## gatty1

From experience maintaining a network of over 10,000 active ports (at a University), Realtek cards are notorious for misbehaving.  They're cheap for a reason!   :Wink: 

Most of the problems we have had here were caused by the card sharing PCI IRQs.  Yes I know PCI is designed to do this, but in about 90% of cases, moving the slot the card was in fixed the problem.

If you can't afford to upgrade to something a little better, like a 3com or Intel Pro/100 card then try moving the slot your card is in.  Of course, if it's onboard then you can't do this.

----------

