Skip to content

Instantly share code, notes, and snippets.

@zeekay
Created January 28, 2014 09:19
Show Gist options
  • Save zeekay/8664513 to your computer and use it in GitHub Desktop.
Save zeekay/8664513 to your computer and use it in GitHub Desktop.
Lies, damned lies, and benchmarks.
$ ab -k -c 100 -n 10000 http://go.dev:1337/
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 localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software:
Server Hostname: localhost
Server Port: 1337
Document Path: /
Document Length: 12 bytes
Concurrency Level: 100
Time taken for tests: 0.213 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 10000
Total transferred: 1530000 bytes
HTML transferred: 120000 bytes
Requests per second: 47039.56 [#/sec] (mean)
Time per request: 2.126 [ms] (mean)
Time per request: 0.021 [ms] (mean, across all concurrent requests)
Transfer rate: 7028.37 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 3
Processing: 1 2 0.5 2 5
Waiting: 1 2 0.5 2 5
Total: 1 2 0.5 2 6
Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 2
80% 2
90% 3
95% 3
98% 4
99% 4
100% 6 (longest request)
$ ab -k -c 100 -n 10000 http://nodejs.dev:1337/
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 localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software:
Server Hostname: localhost
Server Port: 1337
Document Path: /
Document Length: 12 bytes
Concurrency Level: 100
Time taken for tests: 0.872 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 870000 bytes
HTML transferred: 120000 bytes
Requests per second: 11462.80 [#/sec] (mean)
Time per request: 8.724 [ms] (mean)
Time per request: 0.087 [ms] (mean, across all concurrent requests)
Transfer rate: 973.89 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 4 0.7 4 9
Processing: 2 5 1.6 5 21
Waiting: 2 4 1.5 4 21
Total: 3 9 1.7 9 24
Percentage of the requests served within a certain time (ms)
50% 9
66% 9
75% 9
80% 9
90% 9
95% 10
98% 13
99% 19
100% 24 (longest request)
package main
import (
"zeekay.io/zip"
)
func main() {
zip.Get("/", func(req zip.Req, res zip.Res) {
res.WriteString("hello world!")
})
zip.Listen(":1337")
}
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
} else {
http.createServer(function(req, res) {
res.writeHead(200);
res.end("hello world!");
}).listen(1337);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment