opal-up 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +209 -0
- data/README.md +81 -28
- data/bin/up_ruby +4 -0
- data/bin/up_ruby_cluster +4 -0
- data/ext/up_ext/App.h +606 -0
- data/ext/up_ext/AsyncSocket.h +355 -0
- data/ext/up_ext/AsyncSocketData.h +87 -0
- data/ext/up_ext/BloomFilter.h +83 -0
- data/ext/up_ext/ChunkedEncoding.h +236 -0
- data/ext/up_ext/ClientApp.h +36 -0
- data/ext/up_ext/HttpContext.h +502 -0
- data/ext/up_ext/HttpContextData.h +56 -0
- data/ext/up_ext/HttpErrors.h +53 -0
- data/ext/up_ext/HttpParser.h +680 -0
- data/ext/up_ext/HttpResponse.h +578 -0
- data/ext/up_ext/HttpResponseData.h +95 -0
- data/ext/up_ext/HttpRouter.h +380 -0
- data/ext/up_ext/Loop.h +204 -0
- data/ext/up_ext/LoopData.h +112 -0
- data/ext/up_ext/MoveOnlyFunction.h +377 -0
- data/ext/up_ext/PerMessageDeflate.h +315 -0
- data/ext/up_ext/ProxyParser.h +163 -0
- data/ext/up_ext/QueryParser.h +120 -0
- data/ext/up_ext/TopicTree.h +363 -0
- data/ext/up_ext/Utilities.h +66 -0
- data/ext/up_ext/WebSocket.h +381 -0
- data/ext/up_ext/WebSocketContext.h +434 -0
- data/ext/up_ext/WebSocketContextData.h +109 -0
- data/ext/up_ext/WebSocketData.h +86 -0
- data/ext/up_ext/WebSocketExtensions.h +256 -0
- data/ext/up_ext/WebSocketHandshake.h +145 -0
- data/ext/up_ext/WebSocketProtocol.h +506 -0
- data/ext/up_ext/bsd.c +767 -0
- data/ext/up_ext/bsd.h +109 -0
- data/ext/up_ext/context.c +524 -0
- data/ext/up_ext/epoll_kqueue.c +458 -0
- data/ext/up_ext/epoll_kqueue.h +67 -0
- data/ext/up_ext/extconf.rb +5 -0
- data/ext/up_ext/internal.h +224 -0
- data/ext/up_ext/libusockets.h +350 -0
- data/ext/up_ext/libuwebsockets.cpp +1374 -0
- data/ext/up_ext/libuwebsockets.h +260 -0
- data/ext/up_ext/loop.c +386 -0
- data/ext/up_ext/loop_data.h +38 -0
- data/ext/up_ext/socket.c +231 -0
- data/ext/up_ext/up_ext.c +278 -0
- data/lib/up/node/rack_env.rb +2 -2
- data/lib/up/ruby/cluster_cli.rb +10 -0
- data/lib/up/ruby/rack_cluster.rb +26 -0
- data/lib/up/ruby/rack_env.rb +97 -0
- data/lib/up/ruby/rack_server.rb +26 -0
- data/lib/up/ruby/server_cli.rb +10 -0
- data/lib/up/u_web_socket/rack_env.rb +1 -1
- data/lib/up/version.rb +1 -1
- metadata +71 -18
- data/.gitignore +0 -5
- data/Gemfile +0 -2
- data/example_rack_app/Gemfile +0 -3
- data/example_rack_app/config.ru +0 -6
- data/example_rack_app/rack_app.rb +0 -5
- data/example_roda_app/Gemfile +0 -6
- data/example_roda_app/config.ru +0 -6
- data/example_roda_app/roda_app.rb +0 -37
- data/example_sinatra_app/Gemfile +0 -6
- data/example_sinatra_app/config.ru +0 -6
- data/example_sinatra_app/sinatra_app.rb +0 -7
- data/opal-up.gemspec +0 -27
- data/up_logo.svg +0 -256
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92cb787ff140257bb7f11eecfb460e9c9d458be90e723187e6c4ac9006ce1f22
|
4
|
+
data.tar.gz: 5d5046c915394b4c649bee550df9b25a604707655e6746e8487a0c198c26dd0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be462aea9b579379ee5234dba708bc37ce92705bb3783d2bdcfbce367fc12a0fc606448ee868f7ef1322d65d252e036368a722ddcf9e5a12996511d49f5059d2
|
7
|
+
data.tar.gz: 1baf0f1da6697e95aaea33049b81bc45a0e136a1a79810284df99e7dfa5de58fdf3980fa25ccb74f29a184300f7bafd8c4ef193e1de6173741630c5c2b4ef68a
|
data/LICENSE
CHANGED
@@ -19,3 +19,212 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Files from the uWebSocket project in the lib/up_ext directory have been
|
26
|
+
originally taken from https://github.com/uNetworking/uWebSockets and
|
27
|
+
employ the Apache License as follows and as specified within the files itself:
|
28
|
+
|
29
|
+
Apache License
|
30
|
+
Version 2.0, January 2004
|
31
|
+
http://www.apache.org/licenses/
|
32
|
+
|
33
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
34
|
+
|
35
|
+
1. Definitions.
|
36
|
+
|
37
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
38
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
39
|
+
|
40
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
41
|
+
the copyright owner that is granting the License.
|
42
|
+
|
43
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
44
|
+
other entities that control, are controlled by, or are under common
|
45
|
+
control with that entity. For the purposes of this definition,
|
46
|
+
"control" means (i) the power, direct or indirect, to cause the
|
47
|
+
direction or management of such entity, whether by contract or
|
48
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
49
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
50
|
+
|
51
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
52
|
+
exercising permissions granted by this License.
|
53
|
+
|
54
|
+
"Source" form shall mean the preferred form for making modifications,
|
55
|
+
including but not limited to software source code, documentation
|
56
|
+
source, and configuration files.
|
57
|
+
|
58
|
+
"Object" form shall mean any form resulting from mechanical
|
59
|
+
transformation or translation of a Source form, including but
|
60
|
+
not limited to compiled object code, generated documentation,
|
61
|
+
and conversions to other media types.
|
62
|
+
|
63
|
+
"Work" shall mean the work of authorship, whether in Source or
|
64
|
+
Object form, made available under the License, as indicated by a
|
65
|
+
copyright notice that is included in or attached to the work
|
66
|
+
(an example is provided in the Appendix below).
|
67
|
+
|
68
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
69
|
+
form, that is based on (or derived from) the Work and for which the
|
70
|
+
editorial revisions, annotations, elaborations, or other modifications
|
71
|
+
represent, as a whole, an original work of authorship. For the purposes
|
72
|
+
of this License, Derivative Works shall not include works that remain
|
73
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
74
|
+
the Work and Derivative Works thereof.
|
75
|
+
|
76
|
+
"Contribution" shall mean any work of authorship, including
|
77
|
+
the original version of the Work and any modifications or additions
|
78
|
+
to that Work or Derivative Works thereof, that is intentionally
|
79
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
80
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
81
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
82
|
+
means any form of electronic, verbal, or written communication sent
|
83
|
+
to the Licensor or its representatives, including but not limited to
|
84
|
+
communication on electronic mailing lists, source code control systems,
|
85
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
86
|
+
Licensor for the purpose of discussing and improving the Work, but
|
87
|
+
excluding communication that is conspicuously marked or otherwise
|
88
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
89
|
+
|
90
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
91
|
+
on behalf of whom a Contribution has been received by Licensor and
|
92
|
+
subsequently incorporated within the Work.
|
93
|
+
|
94
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
95
|
+
this License, each Contributor hereby grants to You a perpetual,
|
96
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
97
|
+
copyright license to reproduce, prepare Derivative Works of,
|
98
|
+
publicly display, publicly perform, sublicense, and distribute the
|
99
|
+
Work and such Derivative Works in Source or Object form.
|
100
|
+
|
101
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
102
|
+
this License, each Contributor hereby grants to You a perpetual,
|
103
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
104
|
+
(except as stated in this section) patent license to make, have made,
|
105
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
106
|
+
where such license applies only to those patent claims licensable
|
107
|
+
by such Contributor that are necessarily infringed by their
|
108
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
109
|
+
with the Work to which such Contribution(s) was submitted. If You
|
110
|
+
institute patent litigation against any entity (including a
|
111
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
112
|
+
or a Contribution incorporated within the Work constitutes direct
|
113
|
+
or contributory patent infringement, then any patent licenses
|
114
|
+
granted to You under this License for that Work shall terminate
|
115
|
+
as of the date such litigation is filed.
|
116
|
+
|
117
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
118
|
+
Work or Derivative Works thereof in any medium, with or without
|
119
|
+
modifications, and in Source or Object form, provided that You
|
120
|
+
meet the following conditions:
|
121
|
+
|
122
|
+
(a) You must give any other recipients of the Work or
|
123
|
+
Derivative Works a copy of this License; and
|
124
|
+
|
125
|
+
(b) You must cause any modified files to carry prominent notices
|
126
|
+
stating that You changed the files; and
|
127
|
+
|
128
|
+
(c) You must retain, in the Source form of any Derivative Works
|
129
|
+
that You distribute, all copyright, patent, trademark, and
|
130
|
+
attribution notices from the Source form of the Work,
|
131
|
+
excluding those notices that do not pertain to any part of
|
132
|
+
the Derivative Works; and
|
133
|
+
|
134
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
135
|
+
distribution, then any Derivative Works that You distribute must
|
136
|
+
include a readable copy of the attribution notices contained
|
137
|
+
within such NOTICE file, excluding those notices that do not
|
138
|
+
pertain to any part of the Derivative Works, in at least one
|
139
|
+
of the following places: within a NOTICE text file distributed
|
140
|
+
as part of the Derivative Works; within the Source form or
|
141
|
+
documentation, if provided along with the Derivative Works; or,
|
142
|
+
within a display generated by the Derivative Works, if and
|
143
|
+
wherever such third-party notices normally appear. The contents
|
144
|
+
of the NOTICE file are for informational purposes only and
|
145
|
+
do not modify the License. You may add Your own attribution
|
146
|
+
notices within Derivative Works that You distribute, alongside
|
147
|
+
or as an addendum to the NOTICE text from the Work, provided
|
148
|
+
that such additional attribution notices cannot be construed
|
149
|
+
as modifying the License.
|
150
|
+
|
151
|
+
You may add Your own copyright statement to Your modifications and
|
152
|
+
may provide additional or different license terms and conditions
|
153
|
+
for use, reproduction, or distribution of Your modifications, or
|
154
|
+
for any such Derivative Works as a whole, provided Your use,
|
155
|
+
reproduction, and distribution of the Work otherwise complies with
|
156
|
+
the conditions stated in this License.
|
157
|
+
|
158
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
159
|
+
any Contribution intentionally submitted for inclusion in the Work
|
160
|
+
by You to the Licensor shall be under the terms and conditions of
|
161
|
+
this License, without any additional terms or conditions.
|
162
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
163
|
+
the terms of any separate license agreement you may have executed
|
164
|
+
with Licensor regarding such Contributions.
|
165
|
+
|
166
|
+
6. Trademarks. This License does not grant permission to use the trade
|
167
|
+
names, trademarks, service marks, or product names of the Licensor,
|
168
|
+
except as required for reasonable and customary use in describing the
|
169
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
170
|
+
|
171
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
172
|
+
agreed to in writing, Licensor provides the Work (and each
|
173
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
174
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
175
|
+
implied, including, without limitation, any warranties or conditions
|
176
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
177
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
178
|
+
appropriateness of using or redistributing the Work and assume any
|
179
|
+
risks associated with Your exercise of permissions under this License.
|
180
|
+
|
181
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
182
|
+
whether in tort (including negligence), contract, or otherwise,
|
183
|
+
unless required by applicable law (such as deliberate and grossly
|
184
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
185
|
+
liable to You for damages, including any direct, indirect, special,
|
186
|
+
incidental, or consequential damages of any character arising as a
|
187
|
+
result of this License or out of the use or inability to use the
|
188
|
+
Work (including but not limited to damages for loss of goodwill,
|
189
|
+
work stoppage, computer failure or malfunction, or any and all
|
190
|
+
other commercial damages or losses), even if such Contributor
|
191
|
+
has been advised of the possibility of such damages.
|
192
|
+
|
193
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
194
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
195
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
196
|
+
or other liability obligations and/or rights consistent with this
|
197
|
+
License. However, in accepting such obligations, You may act only
|
198
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
199
|
+
of any other Contributor, and only if You agree to indemnify,
|
200
|
+
defend, and hold each Contributor harmless for any liability
|
201
|
+
incurred by, or claims asserted against, such Contributor by reason
|
202
|
+
of your accepting any such warranty or additional liability.
|
203
|
+
|
204
|
+
END OF TERMS AND CONDITIONS
|
205
|
+
|
206
|
+
APPENDIX: How to apply the Apache License to your work.
|
207
|
+
|
208
|
+
To apply the Apache License to your work, attach the following
|
209
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
210
|
+
replaced with your own identifying information. (Don't include
|
211
|
+
the brackets!) The text should be enclosed in the appropriate
|
212
|
+
comment syntax for the file format. We also recommend that a
|
213
|
+
file or class name and description of purpose be included on the
|
214
|
+
same "printed page" as the copyright notice for easier
|
215
|
+
identification within third-party archives.
|
216
|
+
|
217
|
+
Copyright [yyyy] [name of copyright owner]
|
218
|
+
|
219
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
220
|
+
you may not use this file except in compliance with the License.
|
221
|
+
You may obtain a copy of the License at
|
222
|
+
|
223
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
224
|
+
|
225
|
+
Unless required by applicable law or agreed to in writing, software
|
226
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
227
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
228
|
+
See the License for the specific language governing permissions and
|
229
|
+
limitations under the License.
|
230
|
+
|
data/README.md
CHANGED
@@ -1,40 +1,70 @@
|
|
1
1
|
<img src="https://raw.githubusercontent.com/janbiedermann/up/master/up_logo.svg" alt="UP Logo">
|
2
|
-
<small>Original Image by <a href="https://www.freepik.com/free-vector/colorful-arrows_715199.htm#query=up&position=3&from_view=search&track=sph&uuid=63f9eddf-02a6-4e5c-8178-8cfa507ee33d">Freepik</a>, modified though</small>
|
2
|
+
<small>(Original Image by <a href="https://www.freepik.com/free-vector/colorful-arrows_715199.htm#query=up&position=3&from_view=search&track=sph&uuid=63f9eddf-02a6-4e5c-8178-8cfa507ee33d">Freepik</a>, modified though)</small>
|
3
3
|
|
4
4
|
# UP!
|
5
5
|
|
6
|
-
A high performance Rack server for Opal Ruby, Tech Demo
|
6
|
+
A high performance Rack server for [Opal Ruby](https://github.com/opal/opal), Tech Demo
|
7
7
|
|
8
8
|
## Let Numbers speak first
|
9
9
|
|
10
10
|
```
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
Up!
|
21
|
-
Up! uWS:
|
22
|
-
|
23
|
-
|
11
|
+
Response type: env.to_s "hello_world"
|
12
|
+
Requests/Second:
|
13
|
+
Puma: 9478.41 req/s 50822.38 req/s
|
14
|
+
Unicorn: 12267.86 req/s 16329.68 req/s
|
15
|
+
Falcon: 13569.35 req/s 24041.63 req/s
|
16
|
+
Racer: 14640.34 req/s 15354.14 req/s
|
17
|
+
Agoo: 51455.38 req/s 89022.91 req/s
|
18
|
+
Iodine: 57257.21 req/s <<< 132723.02 req/s
|
19
|
+
Up! node: 2096.64 req/s* 25041.14 req/s
|
20
|
+
Up! ruby: 10616.74 req/s 69388.90 req/s
|
21
|
+
Up! uWS: 2511.65 req/s* 83853.44 req/s
|
22
|
+
Up! node cluster: 6627.05 req/s* 61320.38 req/s
|
23
|
+
Up! ruby cluster: 29807.97 req/s 137782.65 req/s
|
24
|
+
Up! uWS cluster: 8328.87 req/s* 152865.96 req/s <<< fastest
|
25
|
+
|
26
|
+
Latency:
|
27
|
+
Puma: 14.05 ms 2.62 ms
|
28
|
+
Unicorn: 10.26 ms 7.68 ms
|
29
|
+
Falcon: 9.32 ms 5.26 ms
|
30
|
+
Racer: 8.90 ms 8.44 ms
|
31
|
+
Agoo: 2.43 ms 1.51 ms
|
32
|
+
Iodine: 2.18 ms <<< 0.94 ms
|
33
|
+
Up! node: 59.97 ms* 4.99 ms
|
34
|
+
Up! uWS: 49.83 ms* 1.49 ms
|
35
|
+
Up! ruby: 11.76 ms 1.80 ms
|
36
|
+
Up! node cluster: 18.83 ms* 2.04 ms
|
37
|
+
Up! ruby cluster: 4.19 ms 0.91 ms
|
38
|
+
Up! uWS cluster: 14.99 ms* 0.82 ms <<< fastest
|
39
|
+
|
40
|
+
running on/with:
|
41
|
+
Linux, Kernel 6.5.0-x
|
24
42
|
ruby 3.3.0, YJit enabled
|
25
|
-
Opal
|
43
|
+
Opal 2.0-dev with node v20.11.0
|
26
44
|
Puma 6.4.2, 4 workers, 4 threads
|
27
|
-
|
28
|
-
|
29
|
-
|
45
|
+
Falcon 0.43.0, 4 workers, 4 threads
|
46
|
+
Racer 0.1.3, defaults
|
47
|
+
Unicorn 6.1.0, 4 workers
|
48
|
+
Agoo 2.15.8, 4 workers, 4 threads
|
49
|
+
Iodine 0.7.57, 4 workers, 1 thread
|
50
|
+
Up! uWS 0.0.2, 1 worker
|
51
|
+
Up! Node 0.0.2, 1 worker
|
52
|
+
Up! Ruby 0.0.3, 1 worker
|
53
|
+
Up! uWS cluster 0.0.2, 4 workers
|
54
|
+
Up! Node cluster 0.0.2, 4 workers
|
55
|
+
Up! Ruby cluster 0.0.3, 4 workers
|
30
56
|
|
31
57
|
running the example_rack_app from this repo, benchmarked with:
|
32
|
-
|
58
|
+
bombardier http://localhost:3000/
|
59
|
+
|
60
|
+
on my old Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
|
61
|
+
|
62
|
+
* please see section "About the benchmarks ..." below
|
33
63
|
```
|
34
64
|
|
35
65
|
## Introduction
|
36
66
|
|
37
|
-
This is currently mainly a technical demonstration, demonstrating the speed of the Opal Ruby implementation employing Node and
|
67
|
+
This is currently mainly a technical demonstration, demonstrating the speed of the [Opal Ruby](https://github.com/opal/opal) implementation employing [Node](https://nodejs.org/en) and [uWebSocketJs](https://github.com/uNetworking/uWebSockets.js) as runtime. Its not yet a generic, all purpose Rack server, but good for further experimentation, research and open for improvement.
|
38
68
|
|
39
69
|
## Getting started
|
40
70
|
|
@@ -54,11 +84,13 @@ For a Gemfile available from rubygems:
|
|
54
84
|
|
55
85
|
Available with `bundle exec` within the example apps or if this gem is included in your Gemfile:
|
56
86
|
|
57
|
-
- `up` - starts a single worker server using uWebSockets, fastest server
|
58
|
-
- `up_cluster` - starts a cluster of workers using uWebSockets, still fast, depending on workload may be even faster than the single worker or not
|
59
|
-
- `up_node` - starts a single worker server using the standard Node HTTP(S) classes
|
60
|
-
- `up_node_cluster` - starts a cluster of workers using the standard Node HTTP(S) classes, probably faster than `up_node`
|
87
|
+
- `up` - starts a single worker server using Opal with uWebSockets, fastest server
|
88
|
+
- `up_cluster` - starts a cluster of workers using Opal with uWebSockets, still fast, depending on workload may be even faster than the single worker or not
|
89
|
+
- `up_node` - starts a single worker server using Opal with the standard Node HTTP(S) classes
|
90
|
+
- `up_node_cluster` - starts a cluster of workers using Opal with the standard Node HTTP(S) classes, probably faster than `up_node`
|
61
91
|
- `up_bun` - starts single worker server using Bun, requires Opal bun support from [PR#2622](https://github.com/opal/opal/pull/2622)
|
92
|
+
- `up_ruby` - starts a single worker using Ruby with uWebSockets in a native extension
|
93
|
+
- `up_ruby_cluster` - starts a cluster of workers using Ruby with uWebSockets in a native extension
|
62
94
|
|
63
95
|
```
|
64
96
|
Usage: up [options]
|
@@ -75,9 +107,30 @@ When using secure sockets, the -a, -c and -k options must be provided
|
|
75
107
|
|
76
108
|
```
|
77
109
|
|
78
|
-
## Roda
|
110
|
+
## Roda
|
111
|
+
|
112
|
+
A example app for Roda is provided and _appears_ working with the following patches applied:
|
113
|
+
|
114
|
+
- [Changes required to make Roda _appear_ to work](https://github.com/jeremyevans/roda/compare/master...janbiedermann:roda:master)
|
115
|
+
- [Changes required to make Rack _appear_ to work](https://github.com/janbiedermann/rack/commit/1dadea0f9813c2df94715052d2277af13f7d0c0c)
|
116
|
+
|
117
|
+
Please note the phrase "_appear_ to work" in above sentences.
|
118
|
+
To try:
|
119
|
+
- clone Rack 3.0.9 and Roda 3.76
|
120
|
+
- apply the patch sets above
|
121
|
+
- set paths in the example_roda_app to point to your cloned rack & roda repos
|
122
|
+
- and up! the server
|
123
|
+
|
124
|
+
## Sinatra, others ...
|
125
|
+
|
126
|
+
... currently do not work! A example app for Sinatra is provided, for convenience of developing and expanding the capabilities of Opal.
|
127
|
+
|
128
|
+
- [Sinatra patches](https://github.com/sinatra/sinatra/compare/main...janbiedermann:sinatra:main)
|
129
|
+
- [Mustermann patches](https://github.com/sinatra/mustermann/compare/main...janbiedermann:mustermann:main)
|
130
|
+
- [Rack-Session patches](https://github.com/rack/rack-session/compare/main...janbiedermann:rack-session:main)
|
79
131
|
|
80
|
-
|
132
|
+
## About the benchmarks and Opal/Up! performance
|
81
133
|
|
82
|
-
|
134
|
+
The "hello world" benchmark results above demonstrates the great potential of using Opal/Node with uWebSocketsJs on the server for executing ruby, however, the `envt.to_s` benchmark column next to it (results marked with *) also shows, that its still possible to trigger sweet spots in Opal, that can make things a bit slow. Work continues to improve things.
|
83
135
|
|
136
|
+
Link to bombardier, the tool used for benchmarking: [https://github.com/codesenberg/bombardier](https://github.com/codesenberg/bombardier)
|
data/bin/up_ruby
ADDED
data/bin/up_ruby_cluster
ADDED