LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Quick and easy way to measure throughput between two nodes (https://www.linuxquestions.org/questions/linux-networking-3/quick-and-easy-way-to-measure-throughput-between-two-nodes-868998/)

szboardstretcher 03-16-2011 01:33 PM

Quick and easy way to measure throughput between two nodes
 
I was in a situation earlier, where I was not allowed to install software on any servers, but I was expected to fix a networking problem that required me to test the throughput between two nodes on different networks.

Generally, at this point I would use 'iperf' but, being unable to install anything, I was unable to.

So I had to get around this somehow. Here is a simple solution for anyone caught in the same spot.

Code:

cat /dev/zero | pv | ssh 13.4.14.29 "cat > /dev/null"

xeleema 03-16-2011 03:49 PM

Hey, that looks pretty handy! I've never heard of pv up till now.

As I don't run fedora myself (and this isn't in the CentOS repositorys I'm used to frolicing in), I'm linking here;
This is "pipe viewer" (homepage here). Current version is 1.2.0, and it seems pretty flexible, too.

szboardstretcher 03-16-2011 03:54 PM

Quote:

Originally Posted by xeleema (Post 4293015)
Hey, that looks pretty handy! I've never heard of pv up till now.

For anyone else wondering what that is, it's "pipe viewer" (homepage here). Looks like a handy little bugger. :)

Very. With a little imagination it can become a very neat tool.

For example: copying a file with progress...
Code:

pv somefile.txt > /location/somefile.txt
Drive Read test
Code:

pv /dev/zero > /dev/null
Zipping a file with progress

Code:

pv some_file_to_compress.txt | gzip > file_compressed.gz
Copy a file over an SSH tunnel with progress

Code:

pv output.dat | gzip | ssh -p 22 root@3.2.12.12 "cat > /backups/dir/output.tar.gz"
Import a SQL backup with progress (Awesome IMHO)

Code:

pv db.sql | mysql database_name

markfox 03-19-2011 09:59 AM

pv is a great find. Thanks for mentioning it.

But be aware that on fast local networks (ie. anything Gigabit), your CPU may be the bottleneck in anything involving SSH. For example, my little Atom based CPU can only churn through data at about 20MB/s if SSH is involved.


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