Skip to content

Instantly share code, notes, and snippets.

@ylluminate
Forked from bbrowning/README
Created June 7, 2014 18:34
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 ylluminate/7ba969b645ed3b1006f3 to your computer and use it in GitHub Desktop.
Save ylluminate/7ba969b645ed3b1006f3 to your computer and use it in GitHub Desktop.
This is in reference to https://plus.google.com/105596541985629444566/posts/27y819XoT2V
to show simple steps I took to try and reproduce the described issue based upon the
information available. This is very simple benchmarking with an almost vanilla Rails 4
application using sqlite as the database so is not useful other than to demonstrate the
out of the box performance with TorqueBox and Trinidad under these situations is very
close.
# warmup
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
# now go for real
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
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 localhost (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /posts/
Document Length: 635 bytes
Concurrency Level: 6
Time taken for tests: 5.293 seconds
Complete requests: 5000
Failed requests: 0
Keep-Alive requests: 5000
Total transferred: 7225000 bytes
HTML transferred: 3175000 bytes
Requests per second: 944.60 [#/sec] (mean)
Time per request: 6.352 [ms] (mean)
Time per request: 1.059 [ms] (mean, across all concurrent requests)
Transfer rate: 1332.96 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 4 6 3.1 5 74
Waiting: 4 6 3.1 5 74
Total: 4 6 3.2 5 75
Percentage of the requests served within a certain time (ms)
50% 5
66% 6
75% 6
80% 8
90% 10
95% 10
98% 11
99% 13
100% 75 (longest request)
$ wget http://torquebox.org/release/org/torquebox/torquebox-dist/3.1.0/torquebox-dist-3.1.0-bin.zip
$ unzip torquebox-dist-3.1.0-bin.zip -d ~
$ export TORQUEBOX_HOME=~/torquebox-3.1.0
$ export JBOSS_HOME=$TORQUEBOX_HOME/jboss
$ export JRUBY_HOME=$TORQUEBOX_HOME/jruby
$ export PATH=$JRUBY_HOME/bin:$PATH
$ mkdir -p ~/torquebox_examples/rails_example
$ cd ~/torquebox_examples/rails_example
$ gem install rails
$ rails new .
$ rails g scaffold post title body:text
$ RAILS_ENV=production rake db:migrate
$ torquebox deploy --env=production
$ export SECRET_KEY_BASE='foobarbaz'
$ torquebox run
# warmup
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
# now go for real
$ ab -c 6 -n 5000 -k http://localhost:8080/posts/
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 localhost (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /posts/
Document Length: 635 bytes
Concurrency Level: 6
Time taken for tests: 5.896 seconds
Complete requests: 5000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 7095000 bytes
HTML transferred: 3175000 bytes
Requests per second: 848.03 [#/sec] (mean)
Time per request: 7.075 [ms] (mean)
Time per request: 1.179 [ms] (mean, across all concurrent requests)
Transfer rate: 1175.15 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 0
Processing: 4 7 2.1 6 34
Waiting: 4 7 2.1 6 34
Total: 4 7 2.1 6 34
Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 8
80% 9
90% 10
95% 11
98% 13
99% 14
100% 34 (longest request)
# make sure we're using same jruby and such as torquebox test
$ export TORQUEBOX_HOME=~/torquebox-3.1.0
$ export JBOSS_HOME=$TORQUEBOX_HOME/jboss
$ export JRUBY_HOME=$TORQUEBOX_HOME/jruby
$ export PATH=$JRUBY_HOME/bin:$PATH
$ cd ~/torquebox_examples/rails_example
$ gem install trinidad
$ export SECRET_KEY_BASE='foobarbaz'
$ trinidad -e production -t -p 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment