Usage
Build and install the tool with
cabal installFor a simple example, essentially benchmarking the tool itself, first build and
run the simple test server (from main/Main.hs)
echos-serviceand in another terminal run
service-benchmark-tool --thread-count=100 --action-count=1500 --url='http://localhost:8282/echo' --http-client=http-streams --loglevel=infowhich will run 100 threads each making 1500 echo request to the echo-service
using the http-streams package as HTTP client backend and loglevel info.
For help you may type
service-benchmark-tool --helpThe option -p can be used to print out the configuration as a configuration file and
replay a that configuration:
service-benchmark-tool --thread-count=100 -p > config.yml
service-benchmark-tool --config-file=config.ymlInstallation
Installation with Chart Support
Install chart-cairo:
cabal install alex
cabal install gtk2hs-buildtoolsOn Mac OS X with homebrew you must do
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATHand then
cabal install chart-cairoNow you can install the package with:
cabal configure -fwith-chart
cabal installGHC-7.10
For compilation with GHC-7.10 one has to install the HEAD versions of
master of http-common and http-streams from GitHub.
A build with -fwith-chart is not yet supported. You may also have to
explicitely pass -f-old-local.
Profiling
cabal install --enable-profiling --ghc-option=-auto-allThen run the program with +RTS -prof as show in this example:
./dist/build/service-benchmark-tool/service-benchmark-tool --thread-count=50 --action-count=1000 --url='http://127.0.0.1:8282' --http-client=http-client --loglevel=info +RTS -prof -N8Note that there is a bug in GHC that causes the flag -N without argument to
have no effect with the threaded runtime.
ThreadScope
In order to collect event logs the application must be compiled with profiling disabled:
cabal install --constraint='http-client>=0.4.7' --ghc-option='-eventlog' --ghc-option='-rtsopts' --disable-profiling --disable-library-profilingEventlogs can be obtained by running the application with +RTS -ls as show in the following example:
./dist/build/service-benchmark-tool/service-benchmark-tool --thread-count=32 --action-count=1000 --url='http://127.0.0.1:8282' --http-client=http-client --loglevel=info -t 50000000 +RTS -ls -N8This will result in a file called service-benchmark-tool.eventlog in the
working directory. This file can be opend and analyzed with ThreadScope.