Skip to content

Instantly share code, notes, and snippets.

@postmodern
Created January 19, 2011 05:17
Show Gist options
  • Save postmodern/785729 to your computer and use it in GitHub Desktop.
Save postmodern/785729 to your computer and use it in GitHub Desktop.
Net::HTTP::Server benchmark.
$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
$ ab -n 1000 http://localhost:8080/
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 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software:
Server Hostname: localhost
Server Port: 8080
Document Path: /
Document Length: 11 bytes
Concurrency Level: 1
Time taken for tests: 44.139 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 55000 bytes
HTML transferred: 11000 bytes
Requests per second: 22.66 [#/sec] (mean)
Time per request: 44.139 [ms] (mean)
Time per request: 44.139 [ms] (mean, across all concurrent requests)
Transfer rate: 1.22 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 22 44 19.0 45 179
Waiting: 22 43 18.7 44 179
Total: 22 44 19.0 45 179
Percentage of the requests served within a certain time (ms)
50% 45
66% 47
75% 48
80% 50
90% 58
95% 84
98% 102
99% 116
100% 179 (longest request)
#!/usr/bin/env ruby
require 'net/http/server'
Net::HTTP::Server.run(:port => 8080) do |request,socket|
[200, {'Content-Type' => 'text/html'}, ['Hello World']]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment