Skip to content

Instantly share code, notes, and snippets.

@telendt
Created January 16, 2018 20:15
Show Gist options
  • Save telendt/6361f9f21752da0abfa0e39e2f725923 to your computer and use it in GitHub Desktop.
Save telendt/6361f9f21752da0abfa0e39e2f725923 to your computer and use it in GitHub Desktop.
Apache Benchmark
ab -n 32 -c 32 "http://127.0.0.1:8080/"
This is ApacheBench, Version 2.3 <$Revision: 1554214 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient).....done
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 11 bytes
Concurrency Level: 32
Time taken for tests: 1.012 seconds
Complete requests: 32
Failed requests: 0
Total transferred: 4096 bytes
HTML transferred: 352 bytes
Requests per second: 31.62 [#/sec] (mean)
Time per request: 1012.074 [ms] (mean)
Time per request: 31.627 [ms] (mean, across all concurrent requests)
Transfer rate: 3.95 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.5 1 2
Processing: 1008 1009 0.3 1009 1009
Waiting: 1006 1008 0.4 1008 1009
Total: 1009 1010 0.7 1010 1011
Percentage of the requests served within a certain time (ms)
50% 1010
66% 1011
75% 1011
80% 1011
90% 1011
95% 1011
98% 1011
99% 1011
100% 1011 (longest request)
package main
import (
"fmt"
"log"
"net/http"
"time"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
time.Sleep(1 * time.Second)
fmt.Fprint(w, "Hello World")
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment