5xRuby/5xruby.tw — pull request #4 by JuanitoFatas (2014-05-20 20:35:49+00:00)
Title: Use Rack::Deflater to reduce size of response.

* New gem: capybara
* Setup test database:
- config/application.yml.example
- config/database.yml.example
* Setup capybara feature spec

With one fake course. Testing /courses.

siege -t30s -c 10 'http://127.0.0.1:3000/courses'

before:

Transactions: 297 hits
Availability: 100.00 %
Elapsed time: 29.77 secs
Data transferred: 2.60 MB
Response time: 0.46 secs
Transaction rate: 9.98 trans/sec
Throughput: 0.09 MB/sec
Concurrency: 4.61
Successful transactions: 297
Failed transactions: 0
Longest transaction: 0.81
Shortest transaction: 0.10

after:

Transactions: 289 hits
Availability: 100.00 %
Elapsed time: 29.20 secs
Data transferred: 0.79 MB
Response time: 0.54 secs
Transaction rate: 9.90 trans/sec
Throughput: 0.03 MB/sec
Concurrency: 5.38
Successful transactions: 289
Failed transactions: 0
Longest transaction: 1.54
Shortest transaction: 0.10

siege -t10s -c 10 'http://localhost:3000/assets/application.css'

before:

Transactions: 183 hits
Availability: 100.00 %
Elapsed time: 9.63 secs
Data transferred: 15.45 MB
Response time: 0.03 secs
Transaction rate: 19.00 trans/sec
Throughput: 1.60 MB/sec
Concurrency: 0.54
Successful transactions: 183
Failed transactions: 0
Longest transaction: 0.20
Shortest transaction: 0.01

after:

Transactions: 195 hits
Availability: 100.00 %
Elapsed time: 9.90 secs
Data transferred: 1.54 MB
Response time: 0.03 secs
Transaction rate: 19.70 trans/sec
Throughput: 0.16 MB/sec
Concurrency: 0.67
Successful transactions: 195
Failed transactions: 0
Longest transaction: 0.22
Shortest transaction: 0.01

From the figures above we could see data transferred drastically reduced (Data transferred).
Also not we were a bit slower (transaction rate).