jodosha (owner)

Forks

Revisions

gist: 88239 Download_button fork
public
Public Clone URL: git://gist.github.com/88239.git
Embed All Files: show embed
app/controllers/session_controller.rb #
1
2
3
4
5
6
7
8
9
10
class SessionController < ApplicationController
  def read
    render :text => session[:user_id], :status => :ok
  end
 
  def write
    render :text => session[:user_id] = 23, :status => :ok
  end
end
 
config/initializers/session_store.rb #
1
2
3
4
# ...
ActionController::Base.session_store = :active_record_store
ActiveRecord::SessionStore.session_class = ActiveRecord::SessionStore::SqlBypass
 
results.txt #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
ActiveRecord::SessionStore: Session vs SqlBypass
One Mongrel instance in production mode
$ ab -n 1000 -c 50 http://127.0.0.1:3000/session/read
$ ab -n 1000 -c 50 http://127.0.0.1:3000/session/write
 
Session
###############################################################################
### READ
 
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
 
Document Path: /session/read
Document Length: 1 bytes
 
Concurrency Level: 50
Time taken for tests: 10.747 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 287004 bytes
HTML transferred: 1000 bytes
Requests per second: 93.05 [#/sec] (mean)
Time per request: 537.368 [ms] (mean)
Time per request: 10.747 [ms] (mean, across all concurrent requests)
Transfer rate: 26.08 [Kbytes/sec] received
 
Connection Times (ms)
              min mean[+/-sd] median max
Connect: 0 0 1.3 0 10
Processing: 14 528 196.3 506 1149
Waiting: 11 523 195.5 501 1146
Total: 14 529 196.2 506 1149
 
Percentage of the requests served within a certain time (ms)
  50% 506
  66% 515
  75% 533
  80% 560
  90% 667
  95% 1056
  98% 1143
  99% 1147
 100% 1149 (longest request)
 
### WRITE
 
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
 
Document Path: /session/write
Document Length: 2 bytes
 
Concurrency Level: 50
Time taken for tests: 10.011 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 330003 bytes
HTML transferred: 2000 bytes
Requests per second: 99.89 [#/sec] (mean)
Time per request: 500.527 [ms] (mean)
Time per request: 10.011 [ms] (mean, across all concurrent requests)
Transfer rate: 32.19 [Kbytes/sec] received
 
Connection Times (ms)
              min mean[+/-sd] median max
Connect: 0 1 2.4 0 12
Processing: 15 490 104.1 522 1036
Waiting: 10 485 104.6 517 1033
Total: 15 491 103.2 522 1037
 
Percentage of the requests served within a certain time (ms)
  50% 522
  66% 532
  75% 536
  80% 542
  90% 550
  95% 556
  98% 567
  99% 933
 100% 1037 (longest request)
 
SqlBypass
###############################################################################
### READ
 
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
 
Document Path: /session/read
Document Length: 1 bytes
 
Concurrency Level: 50
Time taken for tests: 7.531 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 287002 bytes
HTML transferred: 1000 bytes
Requests per second: 132.78 [#/sec] (mean)
Time per request: 376.571 [ms] (mean)
Time per request: 7.531 [ms] (mean, across all concurrent requests)
Transfer rate: 37.21 [Kbytes/sec] received
 
Connection Times (ms)
             min mean[+/-sd] median max
Connect: 0 0 0.9 0 7
Processing: 11 369 83.6 349 809
Waiting: 9 366 84.1 345 807
Total: 11 370 83.4 349 810
 
Percentage of the requests served within a certain time (ms)
 50% 349
 66% 415
 75% 421
 80% 426
 90% 435
 95% 443
 98% 460
 99% 741
100% 810 (longest request)
 
### WRITE
 
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
 
Document Path: /session/write
Document Length: 2 bytes
 
Concurrency Level: 50
Time taken for tests: 7.802 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 330001 bytes
HTML transferred: 2000 bytes
Requests per second: 128.17 [#/sec] (mean)
Time per request: 390.121 [ms] (mean)
Time per request: 7.802 [ms] (mean, across all concurrent requests)
Transfer rate: 41.30 [Kbytes/sec] received
 
Connection Times (ms)
              min mean[+/-sd] median max
Connect: 0 0 1.1 0 8
Processing: 11 383 94.7 365 885
Waiting: 9 379 95.0 362 883
Total: 11 383 94.2 365 886
 
Percentage of the requests served within a certain time (ms)
  50% 365
  66% 432
  75% 435
  80% 437
  90% 453
  95% 560
  98% 579
  99% 738
 100% 886 (longest request)