Operating System - Linux
1827314 Members
4712 Online
109961 Solutions
New Discussion

How to determine the speed of ethernet/network

 
GnanaShekar
Regular Advisor

How to determine the speed of ethernet/network

Hi,

The data transfer rate between the linux servers here is very slow. For example scp to copy a folder from one machine to another machine takes a long time. The scp shows a speed only between 700KB to 1MB per second. How can I improve the speed, please guide me.

Please suggest.
Thanks & Regards,
-GnanaShekar-
17 REPLIES 17
Vipulinux
Respected Contributor

Re: How to determine the speed of ethernet/network

Hi
To increase the speed try this:

By default scp uses the Triple-DES to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed.

$ scp -c blowfish your_file your_username@remotehost:~

Hope you get the desired speed now.

Cheers
Vipul
Ivan Ferreira
Honored Contributor

Re: How to determine the speed of ethernet/network

Use ethtool to query/set the speed of the network. Disable autonegotiation at the network adapter and switch.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vitaly Karasik_1
Honored Contributor

Re: How to determine the speed of ethernet/network

I suggest you to start with "ifconfig" command for checking errors/drops on ethX interfaces.
With "ethtool" command (http://linux.about.com/od/commands/l/blcmdl8_ethtool.htm?terms=multicast+port) you can check/set NIC parameters.
BTW, what is your network environment? - hubs, switchs?
GnanaShekar
Regular Advisor

Re: How to determine the speed of ethernet/network

Hi,

I tried using "scp -c blowfish". The speed shown was as high as 18MB/s for some time. Now it is only around 1.5MB/s to 2.5MB/s.

How do I determine the speed at which ethernet card is working. Once I find out the speed with which the ethernet cards of both the servers are working I can ask the network administrator about the speed of the switch.
Please suggest.
Thanks & Regards,
-GnanaShekar-




GnanaShekar
Regular Advisor

Re: How to determine the speed of ethernet/network

Hi,
Find below the output of ethtool on both the servers.

[root@bangapps root]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
-------------------------------------------
[root@bangpcrh5 backup]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
Vipulinux
Respected Contributor

Re: How to determine the speed of ethernet/network

Hi

To determine speed of NIC give the following command:

# mii-tool
to get the output:
eth0: negotiated 100baseTx-FD, link ok

you can change the settings of the NIC using mii-tool as well.

Cheers
Ivan Ferreira
Honored Contributor

Re: How to determine the speed of ethernet/network

What is the output of netstat -ni?

Do you get any input/output errors or collisions?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
GnanaShekar
Regular Advisor

Re: How to determine the speed of ethernet/network

Hi,

Find below the output of mii-tool on both the servers.

[root@bangapps root]# mii-tool eth0
eth0: negotiated flow-control, link ok

[root@bangpcrh5 backup]# mii-tool eth0
eth0: negotiated, link ok

Regards,
-GnanaShekar-
Vipulinux
Respected Contributor

Re: How to determine the speed of ethernet/network

Hi

Force the speed on NIC as 100 Mbps and Full duplex:
use the command:
mii-tool --force=100baseTx-FD eth0

Cheers
Vipul
Ivan Ferreira
Honored Contributor

Re: How to determine the speed of ethernet/network

Fron the output it can be seen that is running a 1GB FD, autonegotiation should be enabled for gigabit ethernet.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vipulinux
Respected Contributor

Re: How to determine the speed of ethernet/network

Hi
As you have a gig card dont use mii-tool use:
the foll command:

ethtool speed 1000 duplex full autoneg off

Cheers
GnanaShekar
Regular Advisor

Re: How to determine the speed of ethernet/network

Hi,

[root@bangpcrh5 backup]# ethtool -s eth0 speed 1000 duplex full autoneg off

[root@bangpcrh5 backup]# scp -r bangapps:/backup/* .
root@bangapps's password:
drai_290905.tgz 100% 53MB 17.5MB/s 00:03
kvarghes.tgz 100% 191 0.2KB/s 00:00
aabraham_290905.tgz 57% 2062MB 1.8MB/s 14:36 ETA
----------------------------------------
If you see from the above output... the scp starts with 17.5MB/s but soon drops to 1.8MB/s... See what happed a few minutes later...
----------------------------------------

[root@bangpcrh5 backup]# scp -r bangapps:/backup/* .
root@bangapps's password:
drai_290905.tgz 100% 53MB 17.5MB/s 00:03
kvarghes.tgz 100% 191 0.2KB/s 00:00
aabraham_290905.tgz 62% 2261MB 397.9KB/s 58:11 ETA
---------------------------------------
By the way, why should i turn off autonegotiation?

Please suggest,
Thanks & Regards,
-GnanaShekar-
Muthukumar_5
Honored Contributor

Re: How to determine the speed of ethernet/network

You can use wget or scp to get details.

You can view packet trasaction with,

# netstat -ivn

For tuning you have to see the tcp parameters.

--
Muthu
Easy to suggest when don't know about the problem!
GnanaShekar
Regular Advisor

Re: How to determine the speed of ethernet/network

Hi,

Find below the output of netstat -i on both the servers. The RX-ERR/TX-ERR,RX-DRP/TX-DRP & RX-OVR/TX-OVR are 0.

[root@bangapps root]# netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 1332579 0 0 0 204 0 0 0 BMRU
eth1 1500 0 20730287 0 0 0 20015587 0 0 0 BMRU
lo 16436 0 11447 0 0 0 11447 0 0 0 LRU

[root@bangpcrh5 backup]# netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 32925745 0 0 0 27987878 0 0 0 BMRU
lo 16436 0 14793546 0 0 0 14793546 0 0 0 LRU

Regards,
-GnanaShekar-
Ivan Ferreira
Honored Contributor

Re: How to determine the speed of ethernet/network

If these are 0, then collisions sould be 0, but just check the collisions with ifconfig -a.

What is the performance if you set to 100 MB full duplex instead of 1000?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vitaly Karasik_1
Honored Contributor

Re: How to determine the speed of ethernet/network

- do you see some errors in "dmesg" output? or into /var/log/messages?
- what is your linux distro/version? do you use the latest recommended updates?
Vincent Fleming
Honored Contributor

Re: How to determine the speed of ethernet/network

It might not be your network at all...

IMHO, it's more likely, you have some resource constraint on the receiving server - CPU, memory, disk, or congestion from other sources.

What makes me think this is that it appears that smaller files go "faster", and the variable behavior of the larger transfers.

So, monitor the receiving server (using something like "sar") to try and determine what might be a constraint.

...also, a simple check for connection problems such as lost packets would be to use "ping".

Good luck,

Vince
No matter where you go, there you are.