fhb -- A command-line interface for Faban's HTTP standard driver


fhb [options] 
Command-line options.


fhb provides a simple command-line interface for Faban's HTTP driver. It will automatically create and compile an HTTP driver based on its command-line arguments, execute the driver, and print out a summary of the benchmark results.
fhb is designed for simple benchmarking situations where you want to test the throughput of a single GET or POST request emulating some number of clients. Scalablity of the clients is limited to a single JVM running on a single machine; for more sophisticated usage (including driving a larger load by running multiple agents in multiple JVMs on multiple clients), you must utilize the Faban harness directly.
After execution, the fhb will print out six pieces of information: In addition, the driver will complain if various benchmark conditions aren't met. These indicate that either the server or the client has become bottlenecked. Pay close attention to the client in this case, as if the client is the bottleneck, the metrics aren't a valid indication of the server performance (rather, they are an indication of the client performance). There are three possible errors: The first two of these generally indicate that the client isn't able to keep up with the server.


-J jvm_option
Pass a standard JVM option to the underlying Java Virtual Machine. You may have multiple of these in the command line to pass multiple JVM options.
-D output directory
Use the given directory to hold output. The default for this directory is $ Note that this directory is removed unless the -s option is present.
-f file
Use the provided configuration file. Fields in the configuration file supercedes all command line options except -D (output location).
-r rampUp/steady/rampDown
Amount of time to run the benchmark. The benchmark will have an initial ramp up of rampUp seconds (default 300). It will then measure the responsed during the steady interval (default 300 seconds), and finally ramp down for rampDown seconds (default 120).
-W thinkTime
Amount of time (in milliseconds) each client should wait between requests. The think time includes the amount of time to process the request -- if the driver is unable to process the request within the given think time, it will print an error. The default value is 0.
Save the output of the benchmark run (in the output directory). This allows you to examine the raw Faban output files for more detailed data about the benchmark run.
Perform data substitution on the GET or POST request (see Examples)
-c numThreads
The number of threads in the driver to run. Each thread represents a unique connection to the server -- that is, each thread is a client in a logical sense.
-t 90% threshold
Use the given value as the 90% threshold. The default is 1.0 seconds.
-p file
Use the data in the file as a POST request
Send the POST request as binary (application/octet-stream) data rather than form (application/x-www-form-urlencoded).
Print out the version number of fhb
Print out a help message


Sets the http transport provider. Currently the two options are "sun" and "apache3." The apache3 provider uses the Apache HttpClient 3.1 stack as the underlying transport whereas the Sun provider uses the and from JavaSE.  To set the property, just use the command line option -J -Dfhb.http.provider=provider. The default is apache3.
Attaches the socket auto-timer above or below the ssl stack. The two options are "above" and "below." The ssl auto-timing is only applicable to the apache3 transport provider which uses the Apache HttpClient 3.1 stack as the underlying transport. To set the property, just use the command line option -J -Dfaban.ssl.autotiming=[above|below]. The default is attaching the auto-timer above the ssl stack. Attaching it below excludes the client-side cryptographic processing from the reported times.


Run a simple GET request of logo.gif for 1000 clients:
fhb -J -server -J -Xmx3500m -J -Xms3500m -c 1000 http://localhost:8000/logo.gif
Use the datafile data as POST data to the EchoServlet for 10 clients:
fhb -J -server -J -Xmx3500m -J -Xms3500m com.sun.faban.driver.CommonDriver -c 1000 -p data http://localhost:8000/Echo/EchoServlet
The datafile data may have the following content:

Data Substitutions

Like the Faban HTTP driver it uses, fhb allows for some random data to be inserted into GET or POST requests. To enable this, make sure to include the -S option in your command line. The available random data generators are: To perform these substitions, the desired string is embedded in the GET query string or POST data between the @@ characters. For example, to request a random action in a GET request, you could specify this URL:
http://host:port/MyServlet/TestServlet?action=@@faban.getRandomInt(1, 100)@@
Or in case of a post request with substitutions, your post file may have the following content:
action=@@faban.getRandomInt(1, 100)@@&option=@@faban.getRandomInt(1, 20)@@

Configuration File

The configuration file allows specifying more elaborate benchmarks, albeit not as elaborate as writing a full-fledged Faban driver. The steps for specifying the configuration file are explaining at this location: