Debian Admin - Your way to Debian World

February 25, 2008

Howto Determine the throughput of a pipe command

by @ 6:51 am. Filed under Free Tools

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

If you want to Determine the throughput of a pipe you need to use cpipe.Cpipe copies its standard input to its standard output while measuring the time it takes to read an input buffer and write an output buffer. Statistics of average throughput and the total amount of bytes copied are printed to the standard error output.

Did you ever want to know how fast your tar is or how much data it has transferred already. How about using socket or nc to copy files either with or without compression over a fast network connection, which one is faster?

If you want to know the answer, use cpipe as a totally unscientific approach to measure throughput. Cpipe copies its standard input to its standard output while measuring the time it takes to read an input buffer and write an output buffer. Statistics of average throughput and the total amount of bytes copied are printed to the standard error output.

Install cpipe in Debian

#aptitude install cpipe

Using cpipe

cpipe syntax

cpipe [-b bsize] [-vt] [-vr] [-vw] [-ngr] [-s speed]

Available options

-b buffer size in kB,
1 Int value between 1 and oo.
Default: â128â

-vt show throughput.

-vr show read-times.

-vw show write-times.

-ngr non-greedy read. Donât enforce a full buffer on read before starting to write.

-s throughput speed limit in kB/s,
1 Double value between 1 and oo.

Cpipe Example

The command

tar cCf / - usr | cpipe -vr -vw -vt > /dev/null

results in an output like

in: 19.541ms at 6.4MB/s ( 4.7MB/s avg) 2.0MB
out: 0.004ms at 30.5GB/s ( 27.1GB/s avg) 2.0MB
thru: 19.865ms at 6.3MB/s ( 4.6MB/s avg) 2.0MB

The first column shows the times it takes to handle one buffer of data (128kB by default). The read-call took 19.541ms, the write-call to
/dev/null took just 0.004ms and from the start of the read to the end of write, it took 19.865ms.

The second column shows the result of dividing the buffer size (128kB by default) by the times in the first column.

The third column contains the average over all measured values from the start of the program.

Tags: , , , , ,

You may also be interested in...

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

Related Links:


Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.