LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2008, 11:55 AM   #1
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185

Rep: Reputation: 17
Command Line Bandwidth test?


This may be a stupid question, BUT...

Is there anyway to test bandwidth via command line? I have the need to verify bandwidth for remote locations but only have ssh access.
 
Old 03-24-2008, 01:24 PM   #2
rvca
LQ Newbie
 
Registered: Dec 2005
Location: Vancouver
Distribution: Debian/Ubuntu
Posts: 29

Rep: Reputation: 15
ethstatus?

Hi,

Maybe you are looking for something like this:

ethstatus

http://www.penguin-soft.com/penguin/...ethstatus.html

Cheers,
 
Old 03-24-2008, 02:05 PM   #3
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185

Original Poster
Rep: Reputation: 17
This looks like more of a network (LAN) interface monitoring tool. I am concerned with bandwidth to the internet and back (upload and download speeds).

Thanks
 
Old 03-24-2008, 02:21 PM   #4
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
We've figured that with a 'test' file. Create a file which is representative (we used a 1/2 gig file and a 1 gig file) and transfer it back and forth between the sites in question. You could use SCP or FTP to transfer the files and simply use the time command or your watch to time the transfer. This worked for us to decide on the quickest way to transfer large files.
Hope this helps.
 
Old 02-11-2009, 11:01 AM   #5
rozz
LQ Newbie
 
Registered: Jan 2005
Location: Beirut - Lebanon
Distribution: Fedora
Posts: 18

Rep: Reputation: 0
For testing internet bandwidth (ie "slow" traffic), you can use tethereal, like that
tethereal eth1 -z conv,tcp
Wait for like 10 seconds, then hit ctrl-c, and you will get statistics about the amount of packets transferred... you might need to add up some numbers, then divide by the capture time
I know... ugly.. but hey, this is linux.
You could use time on the command, but remember that tethereal takes about a couple of seconds to start capturing, so that might not be very efficient.

For faster transfers, tethereal will start dropping packets. (check near the bottom, it says something like 151231 packets dropped if this happens. In this case the bandwidth measurement is not correct.

In this case you might want to use the method below:

For testing "pure" network performance (ie without considering the disk drive performance), you can do that.
Firs you will need a ram filesystem. I am running Knoppix now, so the /tmp/ directory is actually mounted in ram
go to one machine (receiving machine) and type

nc -l -p 12345 > /tmp/bwtest


then on the sending machine

time dd if=/dev/zero | nc 1.1.1.1 12345

(1.1.1.1 being the ip of the receiving machine)

wait for half a minute or so, then hit ctrl-c on the sending machine.
Now you have the time of transfer (real)
You can go on the receiving machine and type

ls -lh /tmp/bwtest

And you will get the amount of data received. Divide that by the time, and you get the bandwidth...

On a 100mbps eth crossover link between 2 machines running knoppix, i got 10 megabytes / second.

All the methods above use tools that are usually bundled with the OS.

Alternatively, there is a linux command line tool called iperf which may also provide bandwidth measurements.

Last edited by rozz; 02-11-2009 at 11:06 AM.
 
Old 09-22-2014, 06:46 AM   #6
firewallengineer
LQ Newbie
 
Registered: Jul 2013
Posts: 19

Rep: Reputation: Disabled
Smile

Test Download/Upload Internet Speed in Linux
Use the following command to Test Internet Download and Upload Speed from the Linux Command Line :
Quote:
$ wget -O - https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py | python
Sample output :
Quote:
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from ******* (xxx.xxx.xxx.xxx)...
Selecting best server based on latency...
Hosted by ******* [1.24 km]: 2.458 ms
Testing download speed...
Download: 84.35 Mbits/s
Testing upload speed...
Upload: 77.32 Mbits/s
REFERENCE:
http://www.shellhacks.com/en/HowTo-T...x-Command-Line

I hope this will help :)
 
1 members found this post helpful.
Old 09-22-2014, 05:24 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
It's always nice to test bandwidth close to how one might use it. For example, if system uses small ftp files then create a test based on small ftp. If large html then such.
 
Old 09-22-2014, 06:06 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
"speedtest_cli.py" is a good tool
I have been using it for some time

it is also IN "pip"
https://github.com/sivel/speedtest-cli
 
Old 09-22-2014, 06:34 PM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by firewallengineer View Post
Test Download/Upload Internet Speed in Linux
Use the following command to Test Internet Download and Upload Speed from the Linux Command Line :
That is my favorite way of speed testing as well. Sometimes I have to do it 24/7 in 15 minutes intervals. BUT I see you are using github as a test site. Which is using their bandwidth for no good reason. I do my speed tests downloading a large file from -yes - microsoft.com.

jlinkels
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command-line speed test zmeda Linux - Networking 5 09-22-2014 08:02 AM
howto print a test page from command line ? cccc Debian 1 05-18-2007 06:46 AM
how can i test bandwidth? yenonn Linux - Networking 1 04-15-2005 03:06 AM
Test internet bandwidth tangle Linux - Networking 1 04-13-2005 04:10 PM
bandwidth test arlothemoo General 0 12-13-2002 07:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration