An ab-like benchmark tool run on multi-core cpu
Find a file
2019-10-03 11:33:11 +08:00
testdata add timeout control 2013-05-31 11:06:22 +08:00
.gitignore add benchmark test 2013-04-11 21:32:40 +08:00
.travis.yml add go1.4 2014-12-14 04:04:51 +08:00
benchmark.go method naming and remove unnecessary else block 2013-06-03 12:56:11 +08:00
benchmark_test.go replace += 1 with ++ to pass golint 2014-12-10 20:50:09 +08:00
common.go refactor custom index to slice 2013-04-12 10:56:52 +08:00
common_test.go move some local variable to named return variables 2013-04-27 07:46:15 +08:00
config.go enhance flag check 2013-07-05 13:24:01 +08:00
config_test.go move some local variable to named return variables 2013-04-27 07:46:15 +08:00
context.go remove type for channel that don't need it 2013-04-30 22:40:03 +08:00
context_test.go replace %d with %f to pass go vet 2014-12-11 01:31:05 +08:00
http.go accept various of response size 2015-03-25 18:17:54 +08:00
http_test.go method naming and remove unnecessary else block 2013-06-03 12:56:11 +08:00
LICENSE change apache 2.0 license to MIT license 2013-04-26 23:56:03 +08:00
main.go rename gb.go to main.go 2014-05-06 10:36:40 +08:00
monitor.go bugfix: Stop called on uninitialized Timer 2014-12-14 04:01:27 +08:00
monitor_test.go hide stdout when testing 2013-04-26 08:06:15 +08:00
README.md remove broken link 2019-10-03 11:33:11 +08:00
report.go method naming and remove unnecessary else block 2013-06-03 12:56:11 +08:00
report_test.go replace %d with %f to pass go vet 2014-12-11 01:31:05 +08:00

Go-HttpBench

====

an ab-like benchmark tool run on multi-core cpu

Installation

  1. install Go into your environment
  2. download and build Go-HttpBench
go get github.com/parkghost/gohttpbench
go build -o gb github.com/parkghost/gohttpbench

Usage

Usage: gb [options] http[s]://hostname[:port]/path
Options are:
  -A="": Add Basic WWW Authentication, the attributes are a colon separated username and password.
  -C=[]: Add cookie, eg. 'Apache=1234. (repeatable)
  -G=2: Number of CPU
  -H=[]: Add Arbitrary header line, eg. 'Accept-Encoding: gzip' Inserted after all normal header lines. (repeatable)
  -T="text/plain": Content-type header for POSTing, eg. 'application/x-www-form-urlencoded' Default is 'text/plain'
  -c=1: Number of multiple requests to make
  -h=false: Display usage information (this message)
  -i=false: Use HEAD instead of GET
  -k=false: Use HTTP KeepAlive feature
  -n=1: Number of requests to perform
  -p="": File containing data to POST. Remember also to set -T
  -r=false: Don't exit when errors
  -t=0: Seconds to max. wait for responses
  -u="": File containing data to PUT. Remember also to set -T
  -v=0: How much troubleshooting info to print
  -z=false: Use HTTP Gzip feature

Example:

$ gb -c 100 -n 100000 -k http://localhost/10k.dat

This is GoHttpBench, Version 0.1.9, https://github.com/parkghost/gohttpbench
Author: Brandon Chen, Email: parkghost@gmail.com
Licensed under the MIT license

Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software:        nginx/1.2.6 (Ubuntu)
Server Hostname:        localhost
Server Port:            80

Document Path:          /10k.dat
Document Length:        10240 bytes

Concurrency Level:      100
Time taken for tests:   5.36 seconds
Complete requests:      100000
Failed requests:        0
HTML transferred:       1024000000 bytes
Requests per second:    18652.41 [#/sec] (mean)
Time per request:       5.361 [ms] (mean)
Time per request:       0.054 [ms] (mean, across all concurrent requests)
HTML Transfer rate:     186524.05 [Kbytes/sec] received

Connection Times (ms)
              min	mean[+/-sd]	median	max
Total:        0     	0   3.03 	4 	32

Percentage of the requests served within a certain time (ms)
 50%	 4
 66%	 5
 75%	 6
 80%	 7
 90%	 8
 95%	 10
 98%	 12
 99%	 14
 100%	 32 (longest request)

Author

Brandon Chen

License

This project is licensed under the MIT license