Apache Bench is a load testing tool that ships with Apache HTTP Server but it can also be run against WCF services with basicHttp or wsHttp bindings. The tool itself consists of one EXE file which makes deploying it to multiple client machines a trivial affair.

Notes

  • We used Apache Bench against BizTalk WCF (wsHttp, two-way) receive locations to identify bottlenecks throughout our entire solution
  • Security was disabled on the WCF service that Apache Bench was hitting
  • There is no ramp-up. Apache Bench will hit your service with full force right from the start.
  • Use PerfMon to see how your service and back-end systems are doing
  • Apache bench is very light weight on the client, hardly any CPU utilization at all

Apache Bench command – 200 requests with 50 concurrent calls

ab -T “application/soap+xml; charset=UTF-8″ -p data.xml -n 200 -c 50 http://biztalk/OrderService.svc

data.xml

This file contains the message that Apache Bench will send to the service. Use Fiddler to see and copy what is going over the wire when a normal WCF client is sending messages to your service

Apache Bench output

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking biztalk (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests

Server Software: Microsoft-IIS/7.5
Server Hostname: biztalk
Server Port: 80

Document Path: /OrderService.svc
Document Length: 1766 bytes

Concurrency Level: 50
Time taken for tests: 3.767 seconds
Complete requests: 200
Failed requests: 0
Write errors: 0
Total transferred: 416000 bytes
Total POSTed: 188200
HTML transferred: 353200 bytes
Requests per second: 53.09 [#/sec] (mean)
Time per request: 941.844 [ms] (mean)
Time per request: 18.837 [ms] (mean, across all concurrent requests)
Transfer rate: 107.83 [Kbytes/sec] received
48.78 kb/s sent
156.62 kb/s total

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.6 1 5
Processing: 217 851 312.2 795 1937
Waiting: 216 850 312.2 791 1937
Total: 218 852 312.3 795 1938

Percentage of the requests served within a certain time (ms)
50% 795
66% 922
75% 1026
80% 1079
90% 1255
95% 1551
98% 1781
99% 1879
100% 1938 (longest request)