Skip to content

Instantly share code, notes, and snippets.

@judofyr
Created July 4, 2009 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judofyr/140578 to your computer and use it in GitHub Desktop.
Save judofyr/140578 to your computer and use it in GitHub Desktop.
$:.unshift 'lib'
require 'rubygems'
require 'camping'
require 'parkaby'
Camping.goes :App
module App
include Parkaby::Frameworks::Camping
def self.create
Views.compile!
end
module Controllers
class Index
def get
render :index
end
end
class Nested
def get
render :nested
end
end
end
module Views
def layout
html do
head do
title "Parkaby + Camping"
end
body do
self << yield
end
end
end
def index
h1 'Example'
p 'Just a little test'
end
def nested
div(:id => 'posts') do
20.times do
div(:class => 'header') do
h2 do
a "Title", :href => "http://google.com/"
end
end
div(:class => 'content') do
self << "Content"
end
div(:class => 'meta') do
strong "Written by some guy"
end
end
end
end
end
end
if $0 == __FILE__
App.create
Rack::Handler::Mongrel.run(App, :Port => 3301)
end
~ $ ab -n1000 http://127.0.0.1:3301/
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 127.0.0.1 (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: 127.0.0.1
Server Port: 3301
Document Path: /
Document Length: 180 bytes
Concurrency Level: 1
Time taken for tests: 3.720 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 301000 bytes
HTML transferred: 180000 bytes
Requests per second: 268.84 [#/sec] (mean)
Time per request: 3.720 [ms] (mean)
Time per request: 3.720 [ms] (mean, across all concurrent requests)
Transfer rate: 79.02 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 2 4 7.4 3 61
Waiting: 2 3 7.4 2 61
Total: 3 4 7.4 3 61
Percentage of the requests served within a certain time (ms)
50% 3
66% 3
75% 3
80% 3
90% 3
95% 3
98% 4
99% 60
100% 61 (longest request)
~ $ ab -n1000 http://127.0.0.1:3301/nested
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 127.0.0.1 (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: 127.0.0.1
Server Port: 3301
Document Path: /nested
Document Length: 3501 bytes
Concurrency Level: 1
Time taken for tests: 42.111 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 3623000 bytes
HTML transferred: 3501000 bytes
Requests per second: 23.75 [#/sec] (mean)
Time per request: 42.111 [ms] (mean)
Time per request: 42.111 [ms] (mean, across all concurrent requests)
Transfer rate: 84.02 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 0
Processing: 30 42 22.3 31 102
Waiting: 30 42 22.3 31 102
Total: 30 42 22.3 31 103
Percentage of the requests served within a certain time (ms)
50% 31
66% 32
75% 33
80% 35
90% 88
95% 88
98% 91
99% 94
100% 103 (longest request)
~ $ ab -n1000 http://127.0.0.1:3301/
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 127.0.0.1 (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: 127.0.0.1
Server Port: 3301
Document Path: /
Document Length: 112 bytes
Concurrency Level: 1
Time taken for tests: 1.071 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 233000 bytes
HTML transferred: 112000 bytes
Requests per second: 933.97 [#/sec] (mean)
Time per request: 1.071 [ms] (mean)
Time per request: 1.071 [ms] (mean, across all concurrent requests)
Transfer rate: 212.51 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1 1 4.0 1 58
Waiting: 0 1 4.0 0 58
Total: 1 1 4.0 1 58
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 1
95% 1
98% 1
99% 2
100% 58 (longest request)
~ $ ab -n1000 http://127.0.0.1:3301/nested
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 127.0.0.1 (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: 127.0.0.1
Server Port: 3301
Document Path: /nested
Document Length: 3433 bytes
Concurrency Level: 1
Time taken for tests: 1.478 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 3555000 bytes
HTML transferred: 3433000 bytes
Requests per second: 676.78 [#/sec] (mean)
Time per request: 1.478 [ms] (mean)
Time per request: 1.478 [ms] (mean, across all concurrent requests)
Transfer rate: 2349.56 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 1 1 4.5 1 51
Waiting: 0 1 4.5 1 51
Total: 1 1 4.5 1 51
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 1
95% 1
98% 2
99% 2
100% 51 (longest request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment