Ruby on Rails and App Engine Performance Sample

Statistics are always dangerous, and YMMV, but I wanted to post a set of performance tests I recently ran on a sample (and simple) Ruby on Rails application hosted on App Engine.

These numbers are after the application has warmed up, and I've tried to make this test show results under the best real life circumstances. Ruby on Rails applications do have a higher than normal start-up time on App Engine, an issue acknowledged and currently worked on. After they are warmed up, however, users shouldn't experience a difference.

The test was driven from the ab command, a simple benchmarking tool that comes with any Apache HTTPD software install. I ran the test from a Rackspace Cloud virtual machine.

The Rails code for this test can be found on Github.

Specifically, the controller and action being run in the test:

class ContactsController < ApplicationController

  def index
    @contacts = Contact.all


Note: the database is empty for this test.

Network latency between Rackspace Cloud and Google App Engine:

sladd@slice84717:~$ ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=247 time=24.0 ms
64 bytes from ( icmp_seq=2 ttl=247 time=20.0 ms
64 bytes from ( icmp_seq=3 ttl=247 time=20.0 ms
64 bytes from ( icmp_seq=4 ttl=247 time=20.0 ms
64 bytes from ( icmp_seq=5 ttl=247 time=20.0 ms
64 bytes from ( icmp_seq=6 ttl=247 time=20.0 ms

Finally, after thousands of requests to warm up the application, below are the results. Specifically, I ran 1000 requests with 10 concurrent requests. You can see that the mean request time is 187ms. Remember, this is to connect over the internet, hit App Engine, hit Rails, hit a controller action, reach into the database, return an empty result set, and render a HTML page.

sladd@slice84717:~$ ab -c 10 -n 1000
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,

Benchmarking (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:        Google
Server Hostname:
Server Port:            80

Document Path:          /contacts
Document Length:        53 bytes

Concurrency Level:      10
Time taken for tests:   18.737 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      304056 bytes
HTML transferred:       53000 bytes
Requests per second:    53.37 [#/sec] (mean)
Time per request:       187.371 [ms] (mean)
Time per request:       18.737 [ms] (mean, across all concurrent requests)
Transfer rate:          15.85 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       20   23   1.6     24      24
Processing:    92  158  91.8    132     992
Waiting:       92  158  91.8    132     992
Total:        116  181  91.9    156    1016

Percentage of the requests served within a certain time (ms)
  50%    156
  66%    164
  75%    176
  80%    184
  90%    224
  95%    332
  98%    564
  99%    592
 100%   1016 (longest request)

If interested in learning more about App Engine, Programming Google App Engine: Build and Run Scalable Web Apps on Google's Infrastructure (Animal Guide) is the newest book that I can find.

Popular posts from this blog

Lists and arrays in Dart

Converting Array to List in Scala

Null-aware operators in Dart