-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
161 lines (126 loc) · 4.33 KB
/
README
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
An example of performance with async_sinatra with thin and rainbows.
class AsyncTest < Sinatra::Base
register Sinatra::Async
enable :show_exceptions
get '/test_sync' do
"prova"
end
aget '/test_async' do
body { ["prova async"] }
end
end
with rainbow and 4 worker_processes i obtain:
Requests per second: 805.41 [#/sec] (mean)
Time per request: 124.16 [ms] (mean)
Time per request: 1.24 [ms] (mean, across all concurrent requests)
Transfer rate: 95.10 [Kbytes/sec] received
with thin and one worker i obtain;
Requests per second: 1747.95 [#/sec] (mean)
Time per request: 57.21 [ms] (mean)
Time per request: 0.57 [ms] (mean, across all concurrent requests)
Transfer rate: 183.53 [Kbytes/sec] received
How can be possible this? What difference have thin and rainbows with eventmachine? I have also test
rainbows with one worker but this with only one worker is really fast.
RAINBOW
worker_processes 4
Rainbows! do
use :EventMachine
worker_connections 400
client_max_body_size nil
keepalive_timeout 0
end
ab -n 10000 -c 100 http://localhost:8080/test_async
This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software:
Server Hostname: localhost
Server Port: 8080
Document Path: /test_async
Document Length: 11 bytes
Concurrency Level: 100
Time taken for tests: 12.416 seconds
Complete requests: 10000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 1180708 bytes
HTML transferred: 110066 bytes
Requests per second: 805.41 [#/sec] (mean)
Time per request: 124.16 [ms] (mean)
Time per request: 1.24 [ms] (mean, across all concurrent requests)
Transfer rate: 95.10 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.8 0 66
Processing: 2 122 40.3 115 367
Waiting: 0 122 40.3 115 367
Total: 2 123 40.0 116 367
Percentage of the requests served within a certain time (ms)
50% 116
66% 130
75% 141
80% 148
90% 172
95% 199
98% 241
99% 263
100% 367 (last request)
THIN
ab -n 10000 -c 100 http://localhost:3000/test_async
This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: thin
Server Hostname: localhost
Server Port: 3000
Document Path: /test_async
Document Length: 11 bytes
Concurrency Level: 100
Time taken for tests: 5.721 seconds
Complete requests: 10000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 1050000 bytes
HTML transferred: 110000 bytes
Requests per second: 1747.95 [#/sec] (mean)
Time per request: 57.21 [ms] (mean)
Time per request: 0.57 [ms] (mean, across all concurrent requests)
Transfer rate: 183.53 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.9 0 14
Processing: 22 56 31.2 45 211
Waiting: 17 55 31.3 45 211
Total: 22 56 31.3 46 211
Percentage of the requests served within a certain time (ms)
50% 46
66% 48
75% 51
80% 57
90% 74
95% 166
98% 175
99% 187
100% 211 (last request)