History log of /freebsd-9.3-release/tools/tools/netrate/
Revision Date Author Comments
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


225334 02-Sep-2011 marius

Fix alignment assumptions.

PR: 160289
Approved by: re (kib)
MFC after: 3 days


213574 08-Oct-2010 pluknet

Clean up tools in tools/tools/netrate.

- tcpconnect incorrectly uses err() in usage() with errx() semantics [1]
That produces dirty error message:
tcpconnect: usage: tcpconnect [ip]: Unknown error: 0
- 64-bit aware fixes in printf() usage [2]
o netrate/juggle: time_t has arch-dependent size
o netrate/tcpconnect: don't assume %ll has always 64bit.

PR: 146088 [1], 146086 [2] (modified)
Approved by: kib (mentor)
MFC after: 1 week


209429 22-Jun-2010 rwatson

Add TCP scalability testing wrapper scripts for tcpp.

Sponsored by: Juniper Networks
MFC after: 1 week


209428 22-Jun-2010 rwatson

Revised tuning advice for tcpp benchmarking: do it in loader.conf, and
tweak more TCP/stack parameters.

Sponsored by: Juniper Networks
MFC after: 1 week


208873 06-Jun-2010 rwatson

Rework tcpp output so that it generates a comma-delimited list of values,
optionally with a header if "-h" is passed. Toast CPU time measurement
in the server for now. Remove -C and -T, since we now always report
both connections/sec and Gb/sec.

MFC after: 1 week
Sponsored by: Juniper Networks


208859 05-Jun-2010 rwatson

Although we currently don't compile in CPU-pinning support by default,
add a -P to enable it if it were.

MFC after: 1 week
Sponsored by: Juniper Networks


206972 21-Apr-2010 rwatson

Merge @176820, @176822, @177156 to tcpp from P4 to HEAD:

Improve accuracy of connection data transfer math.

Disable Nagle's algorithm to avoid delaying transfers of data --
will want to refine this to combine payload with header transfer,
however.

Now that we're running w/o Nagle, try to send the initial data
burst with the header in a single TCP segment.

Prefer %zu to %ju for size_t.

MFC after: 1 week
Sponsored by: Juniper, Inc.


204585 02-Mar-2010 uqs

Always assign WARNS using ?=

- fix some nearby style bugs
- include Makefile.inc where it makes sense and reduces duplication

Approved by: ed (co-mentor)


203800 12-Feb-2010 ru

Fixed error checking of pthread(3) functions.

PR: 143807
Submitted by: pluknet (partly)


198136 15-Oct-2009 luigi

Support the specification of a range of destination ports e.g.

netsend 127.0.0.1 6666-7777 [payloadsize] [packet_rate] [duration]

This is useful to test the behaviour of systems that do some kind
of flow classifications and so exhibit different behaviour depending
on the number of flows that hit them.
I plan to add a similar extension to sweep on a range of IP addresses,
so we can issue a single command to flood (obviously, for testing
purposes!) a number of different destinations.

When there is only one destination, we do a preliminary connect()
of the socket so we can use send() instead of sendto().
When we have multiple ports, the socket is not connect()'ed and we
do a sendto() instead. There is a performance hit in this case,
as the throughput on the loopback interface (with a firewall rule
that blocks the transmission) goes down from 900kpps to 490kpps on
my test machine.

If the number of different destinations is limited, one option to
explore is to have multiple connect()ed sockets.

MFC after: 1 month


198132 15-Oct-2009 luigi

A small change to avoid calling gettimeofday() too often
(hardwired to once every 20us at most).

I found out that on many machines round here, i could only get
300-400kpps with netsend even on loopback and a 'deny' rule in
the firewall, while reducing the number of calls to gettimeofday()
brings the value to 900kpps and more.

This code is just a quick fix for the problem. Of course it could be
done better, with proper getopt() parsing and the like, but since
this applies to the entire program i'll postpone that to when i have
more time.

Reviewed by: rwatson
MFC after: 1 month


189623 10-Mar-2009 rwatson

Add tcpp -- TCP parallelism microbenchmark.

This tool creates large numbers of TCP connections, each of which will
transmit a fixed amount of data, between client and server hosts. tcpp can
use multiple workers (typically up to the number of hardware cores), and can
use multiple source IPs in order to use an expanded port/IP 4-tuple space to
avoid problems from reusing 4-tuples too quickly. Aggregate bandwidth use
will be reported after a client run.

While by no means a perfect tool, it has proven quite useful in generating
and optimizing TCP stack lock contention by easily generating high-intensity
workloads. It also proves surprisingly good at finding device driver bugs.


166567 08-Feb-2007 rwatson

Add 's' after printing the send interval to make it clear it's a send
interval.


161861 02-Sep-2006 rwatson

Enforce the compile-time threads limit at run-time, so that a high thread
count argument doesn't cause a segfault or memory corruption when the
compile-time array is overrun.


156735 15-Mar-2006 ru

Style: NO_MAN doesn't need any value.


155892 22-Feb-2006 rwatson

Add multi-process support to simple http micro-benchmark, now the default.
Use -t for thread support. Also added are -n to specify number of threads
or process, and -s to set the length of the test.


155891 22-Feb-2006 rwatson

Add multi-process support to simple httpd micro-benchmark, which is now
the default. With -t, threads are used.


154961 28-Jan-2006 rwatson

Use $FreeBSD$ for the juggle version, rather than $P4$. This is good for
two reasons:

(1) juggle is now maintained in CVS, not P4, so the CVS revision number is
the authoritative one.
(2) Apparently $P4$ requires special handling and juggle was not marked
as needing it, resulting in problems for the P4 importer.

Requested by: gordon


153790 28-Dec-2005 rwatson

Add 'juggle', a simple IPC micro-benchmark that uses various IPC types to
perform varying number of small IPC operations. It runs using a single
process and one thread, a single process and two threads, and using
multiple processes. Critical to its performance measure are the cost and
frequency of context switches, locking overhead, and threading
performance. The benchmark generates .csv output appropriate for reading
into a spreadsheet to generate summary statistics and perform statistical
tests easily.


153470 16-Dec-2005 scottl

Fix compiling on platforms with 64bit time_t.


151705 26-Oct-2005 pjd

Change u_int64_t to uintmax_t and use %ju, so it compiles on 64bit archs.
I changed every u_int64_t to uintmax_t, as we should use eventually
uint64_t anyway those days.


151654 25-Oct-2005 rwatson

Updates and enhancements to the multi-threaded httpd performance test
tool:

- Use uname(3) to query the OS name to report in the HTTP headers.
This is probably more useful than hard-coding FreeBSD.

- If no path is specified, create a 1k temporary file and send that
instead. Pass a file descriptor into http_serve() rather than using
a global fd.

- Add more carriage returns to the HTTP headers to be a bit more
correct. (Suggested by: andre)

- Read to a buffer rather than a single character to reduce the number
of recv() system calls pulling in the HTTP request.

- Properly wait for two, not one, \n's on input.


150997 06-Oct-2005 rwatson

Don't hard-code port numbers, let the user specify them.


150992 06-Oct-2005 rwatson

Improve realism of benchmark httpd: return some HTTP headers as part
of the sendfile() system call.


150990 06-Oct-2005 rwatson

Add basic simplified HTTP benchmark tools to the netrate suite:

- http is a lightweight, multithreaded HTTP query tool, which performs
a timed measurement of the rate at which it can download files using
single-fetch HTTP/1.0. Other than specifying the IP and a URL path,
it requires zero configuration.

- httpd is a lightweight, multithreaded HTTP server tool, which exports
a single file of choice to the HTTP client, and responds with it no
matter what the request. Other than specifying the file to export,
it requires zero configuration.

The goal of these tools is to measure the network costs associated with
HTTP serving, rather than file system, HTTP protocol parsing, error
handling, etc, and as such, parts relating to less interesting components
of HTTP testing are intentionally omitted. Both are linked against
libpthread by default.


150970 05-Oct-2005 rwatson

Add simple TCP connect and TCP receive benchmark components, intended to
measure the rate of TCP connection round trips supported by a host at
the socket layer.


145367 21-Apr-2005 mux

Fix printf() format string errors with 64-bit architectures.

Spotted by: pav


141762 12-Feb-2005 rwatson

Also build the netblast sub-directory, not just netreceive and netsend.

MFC after: 3 days


141761 12-Feb-2005 rwatson

Mark the signum argument to signal_handler() as __unused.

MFC after: 3 days


139121 21-Dec-2004 keramida

Fix the build of netrate/ with WARNS=5 and add a Makefile.inc to
make it the default for all the netrate test tools.

Approved by: rwatson


139103 21-Dec-2004 ru

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


136910 24-Oct-2004 ru

For variables that are only checked with defined(), don't provide
any fake value.


136274 08-Oct-2004 rwatson

Add a version of netsend that uses the interval timer rather than
explicit clock reads to set an overall duration to the send, and
blasts rather than trying to clock output. The goal of netblast,
unlike netsend, is to send as many UDP packets as possible; the
cost is that there's no ability to control the rate, and there's
less accuracy in the timing as the interval timer granularity is
relatively low.


136259 08-Oct-2004 rwatson

Use int format string, not a long format string.


135954 30-Sep-2004 rwatson

While calling perror() on send() failure was useful for debugging the
if_em "wedging" problem, large numbers of perror() calls impacts send
performance. As such, just count the error, don't print it.


135750 24-Sep-2004 rwatson

Print number of "waits" per second during transmission, not just waits
per call to send().


135551 21-Sep-2004 rwatson

Improve netsend timing logic in various ways:
- Centralize time comparison.
- Check clock resolution to make sure it has enough granularity to
implement the desired wait interval.
- Keep track of how many times the timing loop has to spin waiting
for the next send time; report statistics.
- Add commented out warning about deadlines being missed when
spinning.
- Improve statistics reporting generally to provide a more useful
summary of sender condition after a run.


135536 21-Sep-2004 rwatson

Set default socket size for netreceive to 128k to reduce the chances
of the buffer overflowing before netreceive can be scheduled to read
the packets from the socket.


135518 20-Sep-2004 ru

Make this use a standard bsd.subdir.mk.


135485 19-Sep-2004 rwatson

netsend uses an arbitrary maximum send rate to reject bogus arguments.
It was previously 1mpps; raise to 10mpps. While here, get the error
message right.


135042 10-Sep-2004 rwatson

Add netrate (netreceive, netsend), a tool for generating (and sinking)
UDP packets of specified size at a fixed rate. I've been using this for
netperf-related testing.