cpipe: Determine the throughput of a pipe

December 23rd, 2007 edited by paulgear

Article submitted by Todd Troxell. Please help DPOTD by submitting good articles about software you like!

A package I find useful is cpipe. It is simple tool you can use to determine the throughput of a pipe. Potential uses of cpipe might include determining the speed of:

  • backups that use tar and dd
  • your system’s pseudo-random number generator (see below)
  • an OpenSSH tunnel or OpenVPN between two systems on the Internet

For example, to determine the speed at which you can read from /dev/urandom and write to /dev/null, run:

$ cpipe -vt < /dev/urandom > /dev/null

This will produce output like the following:

thru:  56.045ms at    2.2MB/s (   1.3MB/s avg)    1.1MB
thru:  74.936ms at    1.7MB/s (   1.3MB/s avg)    1.2MB
thru:  21.748ms at    5.7MB/s (   1.4MB/s avg)    1.4MB
thru:  90.131ms at    1.4MB/s (   1.4MB/s avg)    1.5MB

You can also use it to measure read times, write times and to limit throughput:

$ cat /dev/zero | cpipe -s 100 -vt > /dev/null
thru: 1256.079ms at  101.9kB/s ( 101.9kB/s avg)  128.0kB
thru: 1259.942ms at  101.6kB/s ( 101.7kB/s avg)  256.0kB
thru: 1260.469ms at  101.5kB/s ( 101.7kB/s avg)  384.0kB

Cpipe’s upstream homepage is It is written by Harald Kirsch. It has been available in Debian since (at least) sarge, and Ubuntu since (at least) dapper.

Posted in Debian, Ubuntu |

4 Responses

  1. toupeira Says:

    A very similar tool is pv, also available in Debian (and Ubuntu I suppose). One nice feature it seems to have over cpipe is that it can also display a progress bar.

  2. circuit_breaker Says:

    dd can do this:
    - check it’s man page for a signal to send to it to print out it’s status. more cumbersome than this app but it’s everywhere.
    - also useful for a pipe’s flow-control w/rate limiting

  3. James Says:

    FreeBSD (and probably other BSDs) send a signal on Ctrl-T that most programs interpret as a request to print status.

  4. Eric Bergen Says:

    pipebench is also useful for measuring pipe throughput.