LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command Line Bandwidth test? (https://www.linuxquestions.org/questions/linux-newbie-8/command-line-bandwidth-test-630270/)

vonedaddy 03-24-2008 11:55 AM

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.

rvca 03-24-2008 01:24 PM

ethstatus?
 
Hi,

Maybe you are looking for something like this:

ethstatus

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

Cheers,

vonedaddy 03-24-2008 02:05 PM

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

DotHQ 03-24-2008 02:21 PM

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.

rozz 02-11-2009 11:01 AM

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.

firewallengineer 09-22-2014 06:46 AM

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 :)

jefro 09-22-2014 05:24 PM

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.

John VV 09-22-2014 06:06 PM

"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

jlinkels 09-22-2014 06:34 PM

Quote:

Originally Posted by firewallengineer (Post 5242288)
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 :D - microsoft.com.

jlinkels


All times are GMT -5. The time now is 10:07 AM.